how to change data type as TEXT without affecting Date Format in Excel Power Query.

AJ_121

New Member
Joined
Jan 3, 2020
Messages
17
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Dear,
I am making Formula of "FROM DATE" & "TO DATE" where Value is Type is Date And Format is dd-mm-yyyy.

When i make it a symbol in Power Query it shows date with time and when i change Data Type as Date then it comes in my required format(dd-mm-yyyy)-Ref attached image1. But when i change Data Type as Text then Date Format Change automatically in m/d/yyyy- Ref attached image2.

I Need the Data Type as TEXT and Date Format in dd-mm-yyyy.
 

Attachments

  • image1.PNG
    image1.PNG
    1.3 KB · Views: 34
  • image2.PNG
    image2.PNG
    1.5 KB · Views: 32

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
how about =TEXT(cell,"dd-mm-yyyy")
 
Upvote 0
how about =TEXT(cell,"dd-mm-yyyy")
Dear
I am Sorry.
I didn't get you.

Where i have to put this formula in Power Query or in Sheet Cell, which you have mentioned??

If I have to put it on Sheet then there is a formula which is ( Current Date-Number ), therefore i cant change anything on Sheet. Only have to change in Power Query.

Please Help.
 
Upvote 0
try Text.From([Date], "en-GB")
eg. = Table.AddColumn(#"Changed Type", "Custom", each Text.From([Date], "en-GB"))
 
Upvote 0
Dear,
I am new in Power Query therefore i am unable to get you.
What i need i am clarifying below :
I need the data from a website where i have to put the date format DD-MM-YYYY. Therefore i am making a formula where i will simply type the date in excel and i will get the data via power query. Therefore i am doing : Selecting data - Data-From Table/Range Now its showing like Image1 Then i am changing Data Type into Date and is showing like Image2 But i need to change the Data type into Text and when i change it into Text then its showing like image3. BUT as you know that I need the Date Format in DD-MM-YYYY without time.


Kindly Provide the full solution.

Thank you.
 

Attachments

  • Image1.PNG
    Image1.PNG
    1.7 KB · Views: 21
  • image2.PNG
    image2.PNG
    1.3 KB · Views: 20
  • image3.PNG
    image3.PNG
    1.9 KB · Views: 23
Upvote 0
Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"FromDate", type date}}),
    TextDate = Table.AddColumn(Type, "TextDate", each Text.From([FromDate], "en-GB"))
in
    TextDate
that's all what I can do with information you provided
 
Upvote 0
or like this:
Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    TypeTextLocale = Table.TransformColumnTypes(Table.TransformColumnTypes(Source,{{"FromDate", type date}}), {{"FromDate", type text}}, "en-GB")
in
    TypeTextLocale
 
Upvote 0
Thanks a lot Sandy. Its Working. I changed "en-GB" into "en-IN" and i got my desired Date Format.

I really appreciate your help.:)
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,984
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top