Forum Discussion
Anonymous
5 years agoNot 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
Hi, Anonymous , you might want to try this
FORMAT(DATEVALUE("12-20-2020"),"yyyy\-mm\-dd")
3 Replies
- CNENFRNL
Community Champion
Hi, Anonymous , you might want to try this
FORMAT(DATEVALUE("12-20-2020"),"yyyy\-mm\-dd")- AnonymousNot applicable
Perfect, thank you!
- amitchandak
Super User
Anonymous , That is strange .Can you a sample pbix after removing sensitive data.