Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
hongho2
Frequent Visitor

power bi

Hi,

 

I have a date field that needs to be converted to nvarchar. In Power Query, I select the field and change the date type to text. How can I ensure that the time is not displayed from the field?

 

I also using this sytax to convert to txt field without showing time, but it didnt' work.

Text.From([#"Backlog[Order Date]"],"YYYY-MM-DD")

 

expression.jpg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @hongho2 ,

Please have a try.

One way is to use the DateTime.ToText function, which returns a textual representation of a datetime value. You can specify the format and the culture of the output as optional parameters.

= Table.TransformColumns(#“Previous Step”, {{“Date”, each DateTime.ToText(_, “MMM d yyyy”), type text}})

This will transform the column “Date” from datetime to text, using the format “MMM d yyyy”.

DateTime.ToText - PowerQuery M | Microsoft Learn

 

Another way is to use the Date.ToText function, which returns a textual representation of a date value. This function is similar to DateTime.ToText, but it only works with date values, not datetime values.

= Table.TransformColumns(#“Previous Step”, {{“Date”, each Date.ToText(_, “dd MMM yyyy”), type text}})

This will transform the column “Date” from date to text, using the format “dd MMM yyyy”.

Date.ToText - PowerQuery M | Microsoft Learn

 

A third way is to use the Text.From function, which returns a textual representation of any value.

= Table.TransformColumns(#“Previous Step”, {{“Date”, each Text.From(_), type text}})

This will transform the column “Date” from any type to text, using the default format. 

Solved: Converting specific text to date in PowerQuery - Microsoft Fabric Community

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

3 REPLIES 3
hongho2
Frequent Visitor

thank you very much !

Anonymous
Not applicable

Hi @hongho2 ,

Please have a try.

One way is to use the DateTime.ToText function, which returns a textual representation of a datetime value. You can specify the format and the culture of the output as optional parameters.

= Table.TransformColumns(#“Previous Step”, {{“Date”, each DateTime.ToText(_, “MMM d yyyy”), type text}})

This will transform the column “Date” from datetime to text, using the format “MMM d yyyy”.

DateTime.ToText - PowerQuery M | Microsoft Learn

 

Another way is to use the Date.ToText function, which returns a textual representation of a date value. This function is similar to DateTime.ToText, but it only works with date values, not datetime values.

= Table.TransformColumns(#“Previous Step”, {{“Date”, each Date.ToText(_, “dd MMM yyyy”), type text}})

This will transform the column “Date” from date to text, using the format “dd MMM yyyy”.

Date.ToText - PowerQuery M | Microsoft Learn

 

A third way is to use the Text.From function, which returns a textual representation of any value.

= Table.TransformColumns(#“Previous Step”, {{“Date”, each Text.From(_), type text}})

This will transform the column “Date” from any type to text, using the default format. 

Solved: Converting specific text to date in PowerQuery - Microsoft Fabric Community

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Ahmedx
Super User
Super User

pls try this

 

= Date.ToText(Date.From([Order Date]))

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.