Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
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:
Has anyone had the same issue?
Thank you
@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 😞
Hello, I cannot share the pbix file but I tried also with the contoso dataset but I encountered the same issue:
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
6 | |
4 | |
3 | |
3 |
User | Count |
---|---|
11 | |
11 | |
8 | |
8 | |
8 |