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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
NZCraig
Helper I
Helper I

Running totals over multiple sites

Hello all,

 

Not sure if I'm asking too much of PowerBI/Power query, or if I'm asking too much of myself 🙂

I have a data table that shows a production value total for 4 sites each day. I need to create a graph for each site, showing its production as a running total. Making one graph, and duplicating and filteringto show each site is easy, but any tips on how to get a running total for each site? I have tried many fo the formulas on here, but have hit one that achieves the desired result yet.

My data looks like the below and I have a master date table called 'Date'[ Calendar Date] that has a relationship to the date column in my fact table (i've added in the column I am trying to get at the end) :

SiteId     Date     Value     (Expected Running value)
101 July 2021     35     35
201 July 2021     20     20
301 July 2021     15     15
401 July 2021     40     40
102 July 2021     10     45
202 July 2021     15     35
302 July 2021     10     25
402 July 2021     12

     52

 

 

Any help would be very much appreciated!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I tried to create a sample pbix file like the attached.

Please check the below picture and the attached pbix file.

 

Slide1.jpg

 

Value measure: = 
SUM( Data[Value] )

 

Running value per site: = 
IF (
    ISFILTERED ( 'Calendar'[Date] ),
    CALCULATE ( [Value measure:], 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

I tried to create a sample pbix file like the attached.

Please check the below picture and the attached pbix file.

 

Slide1.jpg

 

Value measure: = 
SUM( Data[Value] )

 

Running value per site: = 
IF (
    ISFILTERED ( 'Calendar'[Date] ),
    CALCULATE ( [Value measure:], 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thanks Jihwan_Kim, this one worked a treat. 

FarhanAhmed
Community Champion
Community Champion

You can try following 

Running Total = CALCULATE(SUM('Table (2)'[Value]), FILTER(ALLEXCEPT('Table (2)','Table (2)'[SiteId]),'Table (2)'[Date]<=SELECTEDVALUE('Table (2)'[Date])))






Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




Thanks FarhanAhmed, I struggled with this one a bit once I tried to get a bit fancier with some other data, but it worked for the intial tables I had.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors