Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mrbartuss
Helper I
Helper I

Dynamic formatting isn't working as expected for data label details

I need to change the number format to show 'MM' for millions and 'M' for thousands (instead of the default 'M' and 'K').

To achieve this, I'm using the following dynamic format:

VAR CurrentValue = SELECTEDMEASURE()
RETURN
    SWITCH(
        TRUE(),
        CurrentValue <= 1E3, "#,0.0",
        CurrentValue <= 1E6, "#,0,.0M",
        CurrentValue <= 1E9, "#,0,,.0MM"
    )

Unfortunately, I've found that this doesn't work correctly for data labels. I have data labels turned on for both 'Actuals' and 'Plan,' and, as you can see, the dynamic formatting works as expected there. However, when I add 'Plan' as a data label detail for 'Actuals,' the units disappear entirely, as if the dynamic format isn't being applied at all.

Does anyone know why this is happening? Is this a known issue, or am I missing something?dynamic-formatting-isnt-working-as-expected-for-data-label-v0-8o3yeowww9je1.jpegdynamic-formatting-isnt-working-as-expected-for-data-label-v0-xlmisewww9je1.jpegdynamic-formatting-isnt-working-as-expected-for-data-label-v0-nw0yrixww9je1.jpeg

6 REPLIES 6
Anonymous
Not applicable

Hi @mrbartuss 

Has your problem been resolved? If so, could you mark the corresponding reply as the solution so that others with similar issues can benefit from it?

 


Best Regards,

Jayleny

speedramps
Super User
Super User

Do you know how to create a Field Parameter?

Learn how here 

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

You can create a field parameter with lots of measure

some intergers some currency and some percentages

 

The group these into categories intergers, currency and percentages.

This will add the category column to the field paramater table.

You can then use that column in then calculatation group with
SELECTEDMEASURE() and a SELECTEVALUE to determin the file parameter category

and apply the approriate fomatting logic.
Thus simulating the dynamic behaviour.

However, field paramters are not supported and have known issue.

See limitation in documenation

 

 

 

 

speedramps
Super User
Super User

Do you know how to use calculation group?

You could use calculation group to format mesures with SELECTED(measures)
Lean how here

https://learn.microsoft.com/en-us/power-bi/transform-model/calculation-groups

Are you suggesting creating a calculation item with SELECTEDMEASURE() and applying the dynamic format to it? Wouldn't this format all measures the same way? How would it handle measures that should be formatted as percentages or other formats?

speedramps
Super User
Super User

 

Answer = 
VAR CurrentValue = SUM(yourdata[Sales])
VAR formatstring =
    SWITCH(
        TRUE(),
        CurrentValue <= 1E3, "#,0.0",
        CurrentValue <= 1E6, "#,0,.0M",
        CurrentValue <= 1E9, "#,0,,.0MM"
    )
RETURN
FORMAT(CurrentValue,formatstring)

speedramps_0-1739628942906.png

Please click thumbs up just for the helpful suggestion. 👍

Then click [accept solution] it is works.

Thank you 😀

Thank you for that. However in a simple table even my dynamic format solution works. The problem is that id does not, for example, for data label details.

So you're suggesting I should duplicate all measures with FORMAT function?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.