The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello All,
This is a sample of my data:
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.
hi @e175429 ,
Please share the sample data in plain text (currently ist an image and cant copy). will try to buiid the solution.
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
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
)
)
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:
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:
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:
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
User | Count |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
20 | |
15 | |
14 | |
10 | |
7 |