Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
11 | |
9 | |
6 |