Forum Discussion
Anonymous
7 years agoNot applicable
Formatting a date in a measure (DAX)
This should be simple but can't see how to format a date in a measure. This measure works fine except it give me a date/time format. And all I want is a MM/DD/YYYY format: Right now it is showin...
- 7 years ago
Works for me...
Try...
Measure = "Between " & FORMAT ( ( CALCULATE ( AVERAGEX ( prd_f_GW_Stats, prd_f_GW_Stats[TubeUsage1] ), FILTER ( prd_f_GW_Stats, prd_f_GW_Stats[LRFlag] = "NLR" ) ) - CALCULATE ( AVERAGEX ( prd_f_GW_Stats, prd_f_GW_Stats[TubeUsage1] ), FILTER ( prd_f_GW_Stats, prd_f_GW_Stats[LRFlag] = "LR" ) ) ) / CALCULATE ( AVERAGEX ( prd_f_GW_Stats, prd_f_GW_Stats[Burn Rate] ), FILTER ( prd_f_GW_Stats, prd_f_GW_Stats[LRFlag] = "LR" ) ) + TODAY (), "M/d/yyyy" )
Chihiro
Solution Sage
7 years agoInstead of applying format in the measure formula, you could apply format in model.
With measure highlighted.
Go to "Modeling" tab, and use "Format:" drop down. Apply formatting of your choice.
- Anonymous7 years agoNot applicable
That doesn't work because this measure is part text and part date
- Chihiro7 years ago
Solution Sage
Ah I missed that part. Then nest the date portion in FORMAT()
Ex: FORMAT(TODAY(),"M/d/yyyy")
- Anonymous7 years agoNot applicable
I tried that but I got an error
- aanyoti5 years ago
Helper I
This worked for me, thanks!