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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Dynamic format bug on Stacked bar chart

When you using a dynamic formated measure on a stacked bar chart, the display is not consistent :

MorphDustr_0-1686213012620.png

The measure I use is :

 

 

 

 

 

VAR currentvalue = CALCULATE(SELECTEDMEASURE(), ALLSELECTED('Table'[Dimension]))
return
SWITCH (
    TRUE (),
    currentvalue  < 1E3, "#,0",
    currentvalue  < 1E6, "#,0,.0 K",
    "#,0,,.0 M"
)

 

 

 

 

 

 

I tried as well with the classic 

 

 

 

 

SWITCH (
    TRUE (),
    SELECTEDMEASURE () < 1000, "#,##0",
    SELECTEDMEASURE () < 1000000, "#,##0,.0 K",
    "#,##0,,.0 M"
)

 

 

 

 

 

But the result is the same.

My analysis is that if there is a dimension will null values, except for the first one, the dynamic format isn't used.

Example 1 : legend order Yes and No

MorphDustr_1-1686213361173.png

Example 2 : same graph with reversed legend order :

MorphDustr_2-1686213436043.png

 

Status: Needs Info
Comments
Anonymous
Not applicable

Hi @MorphDustr 

I tried to restore the scene based on the information you provided, but failed. Can you provide your sample for reference ?

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

Best Regards,
Community Support Team _ Ailsa Tao

MorphDustr
Regular Visitor

Hello @Anonymous 

Here are some data you can use :

 

ValDimCat
1200000ACat1
900000ACat2
900000BCat1
1200000BCat2

 

I've created a measure :

 

Measure = sum('Table'[Val])

 

And set up dynamic formating :

 

SWITCH (
    TRUE (),
    SELECTEDMEASURE () < 1000, "#,##0",
    SELECTEDMEASURE () < 1000000, "#,##0,.0 K",
    "#,##0,,.0 M"
)

 

 

I've added a stacked bar chart :

MorphDustr_1-1686297994998.png

 

You can notice that then total on DIm = B is not dispplayed in "Millions"

 

If you reverse the sort order on the legend :

MorphDustr_2-1686298249802.png

Now it's the total on Dim = 1 that is not displayed correctly

MorphDustr
Regular Visitor

Hello @Anonymous 

Have you been able to reproduce the issue?

Thanks for your help

dgarrido
Regular Visitor
Hello guys. Have the exact same situation. Really struggling here to understand this PBI bug/issue and to find how to solve it. Any news/solution or idea/direction on this topic? Thank you all in advance for your help!