Forum Discussion
DAX Formatting - Money
I have a graph that changes based on the filter. Below is the SAME GRAPH but with a different GM filter. How do I make the data labels consistent with the data?
So if the data is showing $18,480 --> $18.5K
and if the data is showing $4,184,448 --> $4.2M
I want anything less than $100,000 to show as K and anything over to show in the millions.
Hi nataliesmiy1357,
I would avoid using FORMAT() for this, because it converts the value to text and can cause issues in visuals.
The cleaner approach is to use a dynamic format string on the measure used in the chart.
For example, for your budget measure, keep the measure as numeric:
Travel Budget = SUM('Table'[Travel Budget])Then set the Format string expression for that measure to:
IF( ABS([Travel Budget]) < 100000, "$#,0.0,K", "$#,0.0,,M" )This will show:
$18,480 --> $18.5K
$4,184,448 --> $4.2M
If you have separate measures for Budget, Q1F, and Actuals, apply the same type of dynamic format string to each measure.
Also check the visual formatting pane and set the data label Display units to None or avoid forcing it to Millions, otherwise Power BI may override the measure formatting and show small values as $0.0m .
Best regards,
Solutions Architect · Microsoft Fabric Specialist · Parchitect
💡 Did my response help you? Clicking Kudos is a small gesture that goes a long way, it encourages contributors and helps the community thrive!
✅ Did I answer your question? Please mark my post as a Solution, it helps others find the answer faster.
4 Replies
- parry2kSuper User
nataliesmiy1357 take advantage of dynamic formatting. Please don't use the FORMAT function; it will make a number into text. Here is one video that I did a long time ago. You can follow the solution and tweak it as per your needs.
- ParchitectSolution Sage
Hi nataliesmiy1357,
I would avoid using FORMAT() for this, because it converts the value to text and can cause issues in visuals.
The cleaner approach is to use a dynamic format string on the measure used in the chart.
For example, for your budget measure, keep the measure as numeric:
Travel Budget = SUM('Table'[Travel Budget])Then set the Format string expression for that measure to:
IF( ABS([Travel Budget]) < 100000, "$#,0.0,K", "$#,0.0,,M" )This will show:
$18,480 --> $18.5K
$4,184,448 --> $4.2M
If you have separate measures for Budget, Q1F, and Actuals, apply the same type of dynamic format string to each measure.
Also check the visual formatting pane and set the data label Display units to None or avoid forcing it to Millions, otherwise Power BI may override the measure formatting and show small values as $0.0m .
Best regards,
Solutions Architect · Microsoft Fabric Specialist · Parchitect
💡 Did my response help you? Clicking Kudos is a small gesture that goes a long way, it encourages contributors and helps the community thrive!
✅ Did I answer your question? Please mark my post as a Solution, it helps others find the answer faster.
- nataliesmiy1357Helper IV
Thank you so much - I did that formula and my numbers still look weird. What did I do wrong?
Dollar Format =VAR v = SUM('FY27 Actuals'[Actuals Amount])RETURNIF(ABS(v) < 100000,"$#,0.0,K","$#,0.0,,M")
- Rupa01Solution Sage
Hi nataliesmiy1357, below solution uses dynamic format string on the measure, which can be used in the chart. Below is an example, keeping the measure numeric.
Travel Budget Measure = VAR _budget = SUM('Table'[Travel Budget]) RETURN SWITCH( TRUE(), ABS(_budget) < 1000, _budget, ABS(_budget) < 1000000, DIVIDE(_budget, 1000), DIVIDE(_budget, 1000000) )Go to Model view and select Travel Budget Measure. Go to properties, go to format and select dynamic.
Now, use below logic to format the expression.
VAR _budget = SUM('Table'[Travel Budget]) RETURN SWITCH( TRUE(), ABS(_budget) < 1000, "$#,##0", ABS(_budget) < 1000000, "$#,##0.0""K""", "$#,##0.0""M""" )This will show as below -
💡 Helpful? Give a Kudos 👍 — keep the community growing
✅ Solved your issue? Mark as Solution ✔️ — help others find it faster
Best regards,
Rupasree Achari | BI & Fabric Analytics Engineer