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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dynamic Line Chart with Total and many lines

Hi Experts
 
I am trying to create and dynamic line chart based on status, current i have measure that is the sum the Staus A and B and I plot these to give me multiple line and then I sum the two Status to get the total. See pbix..
 
I want to be able to dynamically have a total line, and also be able to select either Status A and or B or both on the same graph.

https://www.dropbox.com/s/1gm1qzku7abd3gu/line_and_bar.pbix?dl=0
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous Please create two measure 

Total = CALCULATE(SUM('Table (2)'[amount]),ALL('Table (2)'[status]))

SelectedStatus = CALCULATE(SUM('Table (2)'[amount]),ALLSELECTED('Table (2)'[status]))

First is for total and second is for selected status. let me know if have any question 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Anonymous Please create two measure 

Total = CALCULATE(SUM('Table (2)'[amount]),ALL('Table (2)'[status]))

SelectedStatus = CALCULATE(SUM('Table (2)'[amount]),ALLSELECTED('Table (2)'[status]))

First is for total and second is for selected status. let me know if have any question 

Anonymous
Not applicable

hi vimal...

 

slight issue if you add a slicer to the pbix file, and you select only status A, the graph works fine, when you select both A and B i would expect to see two line and the total. But i am getting the sum of lines A and B and the total which is incorrect. see image

 

Capture.PNG

 

Anonymous
Not applicable

many thanks.. vimal much appericated.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.