Forum Discussion
variable decimal precision
- 10 years ago
I think you're out of luck on individual formatting for each placement of a measure. One of the nice features of PowerBI is formatting something once and then never again. If you have the measure in a table here and a matrix there, changing the formatting on either one will apply to the whole report.
The creation of duplicate measures with only the formatting different is probably the only route. Hopefully you don't need too many.
Could you use the FORMAT function for this?
See http://www.kasperonbi.com/dynamic-format-using-dax/ and https://msdn.microsoft.com/en-us/library/ee634924.aspx for instructions/examples.
You may need to wrap it in another function to define each of the different display scenarios. So you could say if filtered like this, then display 1 decimal place, if filtered some other way, display two decimal places.
Some visuals also allow you to customize the level of precision for that particular visual.
Thanks for the suggestion. Great functionality to know about!
This solution provides dynamic formating, but not context-sensitive formating. I don't know how I would programmatically be able to grab something that indicated the context the measure was being used in - which is what I need.