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
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.

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
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.

Top Solution Authors