Forum Discussion
Measures - editing number formats
- Anonymous9 years ago
Hi,
If you use DAX to create a measure for the field you are using you can wrap that in the format function, e.g.
Measure = FORMAT( SUM( Table[Sales]), $#,##0;($#,##0) )The format function can take user defined formats as shown above (above is brackets for negative, comma separated dollar format.
For a bigger list of user defined function see here:https://msdn.microsoft.com/en-us/library/ee634206.aspx
Hope this helps,
Will
Hi, I am trying to format my measure with 0.00% but it is giving me an error. Can you please help?
(I have tried 0% to just simplify but still get error)
I have tried a few things:
MTD Rev Var % = Format((Divide([MTD Rev Var],[LY MTD Rev])),0%)
MTD Rev Var % = Format(Divide([MTD Rev Var],[LY MTD Rev]),0.00%)
Error message:
The following syntax error occurred during parsing: Invalid token, Line 1, Offset 46, %.
The following syntax error occurred during parsing: Invalid token, Line 1, Offset 45, %.
Hi,
Do you definitely need to use the format function?
It looks like you could just create your measure (without the format function) and then format the measure itself as shown in a previous answer on this thread.
I would recommend doing this as the format function creates a string in the correct format but formatting the measure leaves it as a number, which is often more useful.
Thanks,
Will
- Anonymous8 years agoNot applicable
'the format function creates a string in the correct format but formatting the measure leaves it as a number'
Thanks for this. I couldn't understand why using FORMAT wasn't working for me and now I do. I've used the option in Modeling.