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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Rita_Vaz
Frequent Visitor

Dynamic Formatting not working properly

Hello everyone, 

 

I am having some issues with the dynamic formatting of a measure. I am using this simple code in the format: 

 

SWITCH (
    TRUE (),
    SELECTEDMEASURE () >= 0 && SELECTEDMEASURE () < 1000,FORMAT ( SELECTEDMEASURE (),  "#0 " ),
    SELECTEDMEASURE () >= 1000 && SELECTEDMEASURE () < 1000000, FORMAT ( SELECTEDMEASURE (),  " #,##0,.0 k" ),
    SELECTEDMEASURE () >= 1000000 &&  SELECTEDMEASURE () < 1000000000,FORMAT ( SELECTEDMEASURE (),"#,##0,,.0 M" ),
    SELECTEDMEASURE () >= 1000000000,FORMAT ( SELECTEDMEASURE (), "#,##0,,,.0 bn")
)

 

I am using this measure in a bar chart with a category in the y-axis and for some categories the data label is misformatted, see image bellow:

 

Rita_Vaz_1-1726738025433.png

 

Has anyone had the same issue? 

 

Thank you

 

4 REPLIES 4
BeaBF
Super User
Super User

@Rita_Vaz Try with:

SWITCH (
TRUE (),
SELECTEDMEASURE () >= 0 && SELECTEDMEASURE () < 1000, FORMAT ( SELECTEDMEASURE (), "#0" ),
SELECTEDMEASURE () >= 1000 && SELECTEDMEASURE () < 1000000, FORMAT ( SELECTEDMEASURE (), "#,##0,.0 K" ),
SELECTEDMEASURE () >= 1000000 && SELECTEDMEASURE () < 1000000000, FORMAT ( SELECTEDMEASURE (), "#,##0,,.0 M" ),
SELECTEDMEASURE () >= 1000000000 && SELECTEDMEASURE () < 1000000000000, FORMAT ( SELECTEDMEASURE (), "#,##0,,,.0 Bn" ),
SELECTEDMEASURE () >= 1000000000000, FORMAT ( SELECTEDMEASURE (), "#,##0,,,.0 Tn" )
)

BBF

Hello, 

 

Thank you for your fast response!

I tried the code you sent but the issue still remains 😞 

 

Rita_Vaz_0-1726740500831.png

 

@Rita_Vaz can you share the pbix file or the sample data under the visual?

Hello, I cannot share the pbix file but I tried also with the contoso dataset but I encountered the same issue:

Rita_Vaz_0-1726756594781.png

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.