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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Strange Legend Error

My stacked bar chart started acting strange after a refresh of my data. I don't even know how to explain it but it seems like my legend categories started breaking up for no reason.

Here's an example:PBI error.JPG

Count of index should be 35 for 'Medium' so 11 + 24 but for some reason in my visual these are not showing as one but rather as two separate bars - even the color is different and the one on the right doesn't even have data labels... and I have the same issue with all the other legend categories.format.JPG

The weirdest thing is that when I go into format data color for this visual I only have the three options (Low, Medium, High - see screenshot) and there is no duplication of 'Medium' or 'Low' etc.

So my legend doesn't even sync up with what the visual shows.

 

I have no idea what might be causing this issue as literally nothing in the data has changed in the columns used in this visual.

 

Any ideas?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The strangest thing is that I have recreated the visual in a new report (copying and pasting all the query steps to make sure it is essentially the same data) and the visual works perfectly there! So it's definitely not the data but almost like something is broken in that specific Power BI report file itself.

View solution in original post

9 REPLIES 9
afaherty
Helper IV
Helper IV

Did anyone ever figure out the solution to this?  I am having the exact same problem.

Anonymous
Not applicable

@mwimberger  And I'm not even using measures in this visual: field.JPG

But the strangest thing is that when I actually write a measure to calculate the number of 'Medium' ones for example then I get the correct 35.measure.JPG

 

Ahh right. @Anonymous 

 

Have you checked that the difference between COUNT and COUNTA ? I think that is where the problem lies. Count ( in the visual with no measures ) will just count numbers, dates and strings and Counta in your measure will count numeric values as well as non blank values, including text, dates and logical values.

 

Let me know if that helps

 

Cheers

 

Manfred

Anonymous
Not applicable

hey @mwimberger 

 

so not sure if I was clear enough on this but my measure is working perfectly. There is nothing wrong with the measure, it's when I DON'T use measures is when I start getting this issue. I'm just unsure why because it worked perfectly before but then started acting up after the latest refresh as mentioned in the OG post. 

I don't actually want to use measures for this visual.

 

any ideas on how to make it work again?

Anonymous
Not applicable

@mwimberger Just to give you an idea what my data looks like it's something like this:

IndexOverall Impact Summary
1Low
2Medium
3Low
4High
5High
Anonymous
Not applicable

The strangest thing is that I have recreated the visual in a new report (copying and pasting all the query steps to make sure it is essentially the same data) and the visual works perfectly there! So it's definitely not the data but almost like something is broken in that specific Power BI report file itself.

mwimberger
Resolver II
Resolver II

Hi @Anonymous

 

It may be that there is an "other" category with some data or calculated bands not being handled correctly. Might want to check the calculation by copying the legend to a matrix visual and seeing it there is a new category that is not Low , Medium or High.   It may be that the <= , > logic has created a gap somewhere and didn't show up before with previous data.

 

I had this problem before and a check on the measures logic helped.

 

If you need help debgging the logic, maybe post that and I can give it a look over

 

Cheers

 

Manfred

 

Anonymous
Not applicable

matrix.JPG@mwimberger    This is what it looks like in a matrix:

Hi @Anonymous  does your measure to assign bands have multiple "Low" and "Medium" Bands?

Here is something that I use to assign bandings.

 

 

 

Overall Impact Summary = switch(true(),

[IMPACT]>=0 && [IMPACT< 0.25  ,"Low"",
[IMPACT]>=0.25 && [IMPACT]< 0.5  ,"Medium"",
[IMPACT]>=0.5 && [IMPACT]< 1  ,"High"",
"Error")

 

If you need a table with upper and lower limits for bands I can give that example too.

 

Limit Band= 
CALCULATE (
    VALUES ( tblBand[Band] ),
    FILTER (
        tblBand,
        [IMPACT] >tblBand[Lower Value]
            && [IMPACT]<= tblBand,[Upper Value]
    )
)

Where the tblBand may be something like this:

   
BandLower ValueUpper Value
Low00.25
Medium0.250.5
High0.51

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.