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
darshaningale
Resolver II
Resolver II

Add a cumulative total in line graph

I have the below sample data to be shown in line chart.

I am able to show the count of Hostname with respect to Type in line chart.

However i want to show one more line which will show the cumulative of all the sum of counts.

 

HostTypeDate
20.164.249.166Low3/25/2023
20.164.176.76Medium2/13/2021
20.164.192.126Medium7/22/2022
20.164.246.8Medium5/8/2021
20.164.246.82Critical4/7/2023
20.164.192.50Low4/1/2020
10.8.0.42Critical3/22/2023
20.164.246.7Medium9/24/2020
20.164.253.10Critical4/8/2023
20.164.184.98Critical3/16/2023
20.164.180.118High4/24/2020
20.164.180.143High4/24/2020
1 ACCEPTED SOLUTION

I have created seperate measures of each "Type" and also created one measure for Cumulative total and added all the measures in the line chart.

Instead of using the "Type" in Legend section.

View solution in original post

5 REPLIES 5
rajulshah
Resident Rockstar
Resident Rockstar

@darshaningale 
Please create a measure using the below DAX function:

Total Count of Host =
CALCULATE ( COUNT ( Host[Host] ), ALL ( Host[Type] ) )

 

You would get the following output:

rajulshah_0-1682570878555.png

Please let me know if this didn't work.

I also want to show count of each Type in the line graph.

So there would be one line each for "High" ,"Medium", "Critical" , "Low" in addition to cumulative total.

Spoiler
darshaningale_0-1682571747989.png

i have these counts. i need one more count which shows cumulative total.

@darshaningale 

 

You can use the following DAX:

Total Count of Host =
CALCULATE ( COUNT ( Host[Host] ), ALL ( Host ) )

I have created seperate measures of each "Type" and also created one measure for Cumulative total and added all the measures in the line chart.

Instead of using the "Type" in Legend section.

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.