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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ZiaAnderson
New Member

How to fix a date formatting error

I have a MonthYear column. Data comes from CSV like this:

ZiaAnderson_0-1673299912278.png

When the column type changes from text to date, it turns into this:

ZiaAnderson_1-1673300048067.png

How can I turn it into "date", but preserve the Month-Year formatting? 

 

Thank you!

 

 

1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

Before you change to type, add a replace values step and replace "-" with "-1-", and then change to Date.

 

Pat

Microsoft Employee

View solution in original post

4 REPLIES 4
ppm1
Solution Sage
Solution Sage

Before you change to type, add a replace values step and replace "-" with "-1-", and then change to Date.

 

Pat

Microsoft Employee

Genius! What didn't i think of that? 🙂 Thank you.

ZiaAnderson
New Member

I tried the first option. 

1. If I keep it as text, I cannot use it as a date picker in my report.

2.  Not sure how to use DAX in my Power Query. Is there a way to format in the same step where the data type changes? Because formatting after the "Change Type" step doesn't make sense - the date is already wrong.

vicky_
Super User
Super User

By default, it will show as dd-mm-yy. I think there are two options - create a duplicate column and keep that as a text format, or use the FORMAT function in DAX to format the output of any measures you want to display.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.