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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
e175429
Helper IV
Helper IV

Running Totals

Hello All,

 

This is a sample of my data:

e175429_0-1755724796052.png

Anyone know what I should do to get the running totals for the Users?

Mind you, my actual data is over 43,000 rows.

 

I tried to upload a sample file but you have to be a SuperUser.

9 REPLIES 9
techies
Super User
Super User

Hi @e175429 please try this

 

Running Total =
CALCULATE (
    COUNTROWS(payments),
    FILTER (
        ALLEXCEPT ( payments, payments[User] ),  
        payments[PaidDate]<= MAX ( payments[PaidDate] )
    )
)
 
techies_0-1756328458036.gif

 

 

 

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978
djurecicK2
Super User
Super User

Hi @e175429 ,

 In addition to what @Rupak_bi has said, you might look at using the RUNNINGSUM visual calculation. Here is some additional info:

https://www.youtube.com/watch?v=pqfBH0ZmYkA

 

Rupak_bi
Super User
Super User

hi @e175429 ,

Please share the sample data in plain text (currently ist an image and cant copy). will try to buiid the solution.



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

@Rupak_bi 

 

A very samall portion of my actal data:

 

Date:                  User:

7/1/2023            Nervis

7/1/2023            Nervis

7/1/2023            Clay

7/3/2023            Walter

7/3/2023            Leveston

7/3/2023            Leveston

7/3/2023            Nervis

7/5/2023            Clay

7/9/2023            Clay

8/14/2023          Walter

8/14/2023          Leveston

8/14/2023          Nervis

2/27/2024          Clay

2/27/2024          Leveston

2/27/2024          Nervis

2/27/2024          Walter

2/27/2024          Leveston

2/27/2024          Leveston

3/19/2024          Clay

Shahid12523
Memorable Member
Memorable Member

Power BI (DAX):

 

Running Total =
CALCULATE(
COUNTROWS('Table'),
FILTER(
ALLSELECTED('Table'),
'Table'[User] = MAX('Table'[User]) &&
'Table'[PaidDate] <= MAX('Table'[PaidDate])
)
)


SQL:

 

COUNT(*) OVER (PARTITION BY [User] ORDER BY PaidDate) AS RunningTotal

Shahed Shaikh
Sahir_Maharaj
Super User
Super User

Hello @e175429,

 

Could you please try the following approach:

Running Total per User :=
VAR CurrentDate = MAX ( 'Fact'[PaidDate] )
RETURN
CALCULATE (
    COUNTROWS ( 'Fact' ),
    FILTER (
        ALLSELECTED ( 'Fact'[PaidDate] ),
        'Fact'[PaidDate] <= CurrentDate
    )
)

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Hey,

 

Thank you for your response. I've created the measure but I'm not sure how to graph this.

This is what I get:

e175429_0-1755787298548.png

Which is not exactly what I am looking for. 


In the table, I want the running totals for everyone, and then when I put a filter on, I would like the running total for that one individual. 

 

I have already created a date table:

e175429_1-1755787413975.png

 

MasonMA
Memorable Member
Memorable Member

Hello @e175429 


1. Build a Date table if this doesn't exist. Suppose this Date table is called 'Date'. 

2. Suppose the table that has data on your screenshot is called 'Fact'. Create a proper one-to-many relationship from 'Date' to your 'Fact'[PaidDate] 

You can use measure, 

RunningTotal:=
CALCULATE(
COUNTROWS('Fact'),
FILTER(
ALL('Date'[Date]), 
'Date'[Date] <= MAX('Date'[Date])
),
VALUES('Fact'[User])
)

 

Thanks. 

 

 

Hey,

 

Thank you for your response, but I'm still having a issue.

 

So, I created your measure and got this:

e175429_3-1755799069727.png

Which is great!

What would I have to do to get a column that shows the total by month per user?

For instance, under Staley, a column next to "running total" would be month "monthly total" where

Sept-24 = 2

Aug-24 = 2

Dec-23 = 5

Oct-23  = 1

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.