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
razamatazzz
Regular Visitor

Can not modify power bi measure to Date Format

Hello All, I have created a power BI report which is embedded into D365. I created a measure which would format the date based on the location the user is i.e DD/MM/YYYY or MM/DD/YYYY.  I need to do this in DAX, because i need to get the location information from the APP (D365 FO) as this is an embedded report. (can not get this from the power bi workspace) 

 

All is working fine, however the measure is coming back as a text and not allowing me to format it to Date, which does not allow to sort it properly especially when the date format is DD/MM/YYYY. 

 

razamatazzz_2-1658835140148.png

 

 

I have tried changing the measure twice but still no luck . I have tried using Format function and date function (please see below)

 

val1 is the value coming back from FO 

val2 is the date that i am trying to format. 

Any help would be DEEPLY appreciatted 

 

razamatazzz_1-1658835058568.png

 

 

razamatazzz_0-1658834988630.png

 

5 REPLIES 5
tamerj1
Super User
Super User

Hi @razamatazzz 
FORMAT functions return string data type. For sorting you need to use a sorting measure "the SELECTEDVALUE ( Table[Date] "  will be jsut fine, and the hide it.

Thanks Tamerj but i need to either use format or the date function to change the format of the Date to dd/mm/yyyy incase the location is based out of the US. Are you saying i can combine the format and selectedvalue formula ?

@razamatazzz 

I'm saying you have to have two measure. One eith FORMAT to disply and one with SELECTEDVALUE to sort. 

I dont think that will work as i have three of these measures and i want the user to be able to sort using the table headers dynamically if they want to 

 

razamatazzz_0-1658839732400.png

 

Hi @razamatazzz ,

 

It seems impossible to do that. If possible, you can use format([date]," en-US mm-dd-yyyy") and use sort it by column to sort it. Because you can not identify 01/04/2022, it is January or April.

 

vchenwuzmsft_0-1659090617569.png

Best Regards

Community Support Team _ chenwu zhu

 

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

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.