Forum Discussion
Dynamic format for measure on column/bar chart
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
- Anonymous3 years agoNot applicable
Here is the sample data:
Customer Sales Customer 1 123 Customer 2 12345 Customer 3 1234567 Here is the sample measure:
Sum of Sales = SUM('Table'[Sales])Here is the format string for the measure:
VAR __AbsVal = ABS(SELECTEDMEASURE()) RETURN SWITCH( TRUE(), __AbsVal < 1000, "#,0", __AbsVal < 1000000, "#,0,.K", __AbsVal < 1000000000, "#,0,,.M", "#,0,,,.B" )This is what I expect:
This is what I see on the bar chart:- lbendlin3 years ago
Super User
SWITCH( TRUE(), SELECTEDMEASURE() < 1000, "#", SELECTEDMEASURE() < 1000000, "#,##0,.0 K", SELECTEDMEASURE() < 1000000000, "#,##0,,.0 M", "#,##0,,,.0 B" )this should get you closer. Still has one decimal, but I'm sure they will address this bug soon: Dynamic Format Strings Bug - Microsoft Power BI Community
- Anonymous3 years agoNot applicable
I know it is a bug, that is why I originally posted this in the "Issues" forum, but somebody moved it here, without any notice.
I also know adding one decimal place helps (as I mentioned in my first post), but I would like to be able to set a dynamic format to 0 decimal places and use it on bar/column chart. As for now it's just not possible.
Nevertheless, thank you for trying to help, much appreciated.