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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
shaebert
Helper III
Helper III

Line Chart Comparing Running Total

Hello, below is an example of data I have for a table for people who register for events from two different years. I am looking to create a line graph that compares cumulative/running total over time. So the graph would have two lines. 

 

Screen Shot 2022-08-23 at 10.27.02 PM.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@shaebert , You can get cumulative measure with help from date table 

 

example

Cumm = CALCULATE(SUM(Table[Value]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

or

 

Cumm = CALCULATE(SUM(Table[Value]),filter(allselected('Date'),'Date'[date] <=max('Date'[date])))

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

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

View solution in original post

4 REPLIES 4
shaebert
Helper III
Helper III

I used the measure as the accepted solution as part of the solution to the problem. However, I had to figure out a couple of other things to get it to work correctly. For example, I wanted to group by week and wanted the running total to start over for each year. Two other posts helped me accomplish this. Then the trick was setting up correctly in the line cart. I had to use weekday numbers for the legend to get it to work correctly. 

 

Thanks for the help above, it got me started!

Anonymous
Not applicable

Hi @shaebert ,

Please try below steps

1.my test table

vbinbinyumsft_0-1661496082617.png

2.add a line chart visual and create a measure

Measure =
VAR cur_date =
    SELECTEDVALUE ( 'Table'[Date] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), 'Table'[Date] <= cur_date )
RETURN
    COUNTROWS ( tmp )

vbinbinyumsft_1-1661496190074.png

If I have misunderstood your request, please feel free to let me know.

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@shaebert , You can get cumulative measure with help from date table 

 

example

Cumm = CALCULATE(SUM(Table[Value]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

or

 

Cumm = CALCULATE(SUM(Table[Value]),filter(allselected('Date'),'Date'[date] <=max('Date'[date])))

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

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

Below is an example of one of the two lines based on the table of data above. Hope this helps clarify what I meant.

 

Screen Shot 2022-08-23 at 11.28.35 PM.png

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.

Top Solution Authors