Study FAQ
How can I change a Power BI measure format without converting its result to text?
Also asked as 2
- Why should I use a dynamic format string instead of FORMAT for a numeric measure?
- How do dynamic format strings keep currency or percentage measures numeric?
Answer
Use a dynamic format string on the model measure. Its separate DAX expression selects a display format while the measure retains its numeric data type. FORMAT returns text, which can prevent expected numeric chart behavior.
In Power BI Desktop, select the model measure, choose Dynamic from the Measure tools Format list, and enter a DAX expression that returns the appropriate format string. A governed format table can supply currency or unit patterns; provide a meaningful default when the context isn't a single valid choice.
Keep value and format logic separate. If the user switches currency, the measure must calculate the converted numeric amount, while the format expression chooses its symbol and decimal pattern. Changing only the symbol relabels the same number and isn't conversion.
Use a calculation-item format expression when the format belongs to a reusable transformation, such as displaying a year-over-year result as a percentage. Use a measure-level expression for formatting specific to one measure.
Check the result in the intended visual, including totals and multiple selections. Dynamic format strings apply to model measures; report measures in a live-connect report can't have this format expression added locally.
Full explanation
DP-600: Calculation Groups, Dynamic Format Strings, and Field Parameters in Power BI
Study guide · DP-600
Read the full explanation