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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
zhannak
Frequent Visitor

Adding sum of categories in a slicer/legend in the line chart

Hi, I've spent a lot of time trying to find the workaround for my task but couldn't do so. I have data for three categories 1,2 and 3 that I want to plot in a line chart. The idea is to be able to plot:

 

a) one separate curve per category

b) more curves together

c) the curve for sum of the categories 1,2 and 3

 

I achieved the first two goals by defining a slicer with these three categories and defining a legend in the chart with the same categories (what I mean is that the column from the data table used for the slicer and the legend in the chart are the same, which allows selecting one or more curves to be plotted separately in the graph), see example below:

ffaa4edd-c40f-4ce1-9bbc-402873c3c51d.png

 

However, I'm having trouble finding a way to plot the c), i.e. the fourth curve which will be the sum for all three categories (cumulative result). In the matrix visual, this is quite easy to achieve because row and column subtotals are calculated and displayed by default, whereas in the slicer it's not very straightforward. I know how to create the DAX expression/measure/column that will calculate the sum of data for three categories, but I don't know how to add it as the fourth category in the slicer and in the legend since it was not there in the original data table. 

 

Any ideas on what should I do?

 

Thank you very much for any help. 

 

 

1 REPLY 1
amitchandak
Super User
Super User

@zhannak , check if this approach can help

Show Grand total row or Avg Grand total row in Visual: https://youtu.be/OSwRZ4GUhxc

https://amitchandak.medium.com/power-bi-add-grand-total-row-in-the-bar-visual-44c3d1d463be

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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