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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
rpinxt
Solution Sage
Solution Sage

Legend problem with line and stacked column chart

Ok this is the situation in a picture:

rpinxt_0-1696937997723.png

The columns are relates to volumes. And the categories (from the legend) correspond to the volumes.

 

The line however is based on FTE and the category field for those lines is empty (blank).

Therefore in the legend (Blank) is showing, but we want this gone.

However when we in the filter pane switch off (Blank) also the line will dissapear!

This because for all the line FTE values the category is blank, so excluding this also excludes the values for the line...

 

Is there a descent way to fix this??

1 ACCEPTED SOLUTION
mickey64
Super User
Super User

How about use measures?

 

Affiliate = SUMX(FILTER('Table name','Table name'[category]="Affiliate"),'Table name'[volume])

Direct =  SUMX(FILTER('Table name','Table name'[category]="Direct"),'Table name'[volume])

Distributor = SUMX(...

 

View solution in original post

6 REPLIES 6
rpinxt
Solution Sage
Solution Sage

Thanks @mickey64 , but I was able to make the correct measure with calculate and filter 🙂

And indeed this way I can have 3 colunm values and 1 line value and the blank is not bothering anymore.

Thanks a lot for putting me in the correct direction! 👍

mickey64
Super User
Super User

How about use measures?

 

Affiliate = SUMX(FILTER('Table name','Table name'[category]="Affiliate"),'Table name'[volume])

Direct =  SUMX(FILTER('Table name','Table name'[category]="Direct"),'Table name'[volume])

Distributor = SUMX(...

 

Hmm so you say instead of 1 column Y-axis field, make 3 for the separate legend values?

rpinxt_0-1696946810732.png

Looks like I can only add 1 column y-axis field.

The line axis could hold more I see but that is of no use.

I think you can add some measures after you remove 'Category' from 'Column legend'...

You are correct.

Will look into this.

Somehow my SUMX is not returning data....

 

Affiliate_units = SUMX(FILTER('AVN Excel Data','AVN Excel Data'[Category]="Affiliate"),[Units])
 
So maybe if I get this fixed I can solve it like this.

How about this formula below?

 

Affiliate_units = SUMX(FILTER('AVN Excel Data','AVN Excel Data'[Category]="Affiliate"),'AVN Excel Data'[Units])

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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