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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

DAX Format is not returning the specified text format

This is not a new project, it has previously worked for ~2 months and today it does not.

 

I've created a text column with the following: 

Due Date = IF(ISBLANK(Admin[Priority Req.(Mark with X) ]),FORMAT(Admin[Date Due],"YYYY-MM-DD"),"! EXPEDITE !")
The reason I need it formatted like this is that I sort the report table by this column and want the ! EXPEDITE ! lines to show up first, then oldest first chronologically after that. With a text cell, 1-21-2021 is showing due before 12-20-2020 whereas 2020-12-20 shows before 2021-1-21
Column "Priority Req....." is formatted as text and "Date Due" is formatted as a date.
 
My results are:
"! EXPEDITE !" works as intended.
FORMAT will only return MM/DD/YYYY, regardless of if I type DD-MM-YYYY, DD-YYYY-MM, etc. Using / instead of - does not change the results.
 
I've tried adding another column without the IF, 
test = FORMAT(Admin[Date Due],"YYYY-MM-DD") and this does not return the specified format either.
 
Any help would be greatly appreciated
1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Hi, @Anonymous , you might want to try this

FORMAT(DATEVALUE("12-20-2020"),"yyyy\-mm\-dd")

Screenshot 2020-12-08 025655.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , That is strange .Can you  a sample pbix after removing sensitive data.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
CNENFRNL
Community Champion
Community Champion

Hi, @Anonymous , you might want to try this

FORMAT(DATEVALUE("12-20-2020"),"yyyy\-mm\-dd")

Screenshot 2020-12-08 025655.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Perfect, thank you!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors