Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi PowerBI community,
First off, I hope you are all well and safe in these challenging times.
I was hoping some of you might be able to assist me with a working "running total" formula that I need to amend for two specific scenarios:
DI Impact Actual Running Total = CALCULATE(
SUM ('DI Impact'[DI Impact]),
FILTER (
ALL ('DI Impact'),'DI Impact'[DI Impact Date] <= MAX ('DI Impact'[DI Impact Date])
),'DI Impact'[DI Impact Type]="Actual"
)
31 Jan 2020 | 20 |
29 Feb 2020 | 20 |
31 Jan 2020 | 20 |
30 Apr 2020 | 20 |
30 Mar 2020 | 20 |
I would effectively like my meeasure to return the following when visualized against the DI Impact Date column:
31 Jan 2020 | 20 |
29 Feb 2020 | 40 |
30 Mar 2020 | 60 |
31 Apr 2020 | 80 |
ANd here is my formula:
DI Target Running = CALCULATE(
SUM ('DI Impact'[DI Target.DI Target Amount]),
FILTER (
ALL ('DI Impact'),'DI Impact'[DI Impact Date] <= MAX ('DI Impact'[DI Impact Date])
)
)
Thanks in advance for any suggestion you can provide!
OF
Solved! Go to Solution.
Hi all,
Unfortunately none of these solutions worked 😞 What I ended-up doing:
THanks all for trying to help 🙂
OF
@Anonymous , try the first formula. Or try the second one with a date calendar
DI Impact Actual Running Total = CALCULATE(
SUM ('DI Impact'[DI Impact]),
FILTER (
ALL ('DI Impact'),'DI Impact'[DI Impact Date] <= MAX ('DI Impact'[DI Impact Date])
&& 'DI Impact'[DI Impact Type]="Actual"
)
)
Or
DI Impact Actual Running Total = CALCULATE(
SUM ('DI Impact'[DI Impact]),
FILTER (
ALL ('Date'),'Date'[Date] <= MAX ('DI Impact'[Date]))
,'DI Impact'[DI Impact Type]="Actual"
)
@amitchandak , thank you for the suggestion. You actually gave me the idea to further amend the formula to be more precise.
Unfortunately it still shows numbers for months in the future whereas I was hoping to show "null"
Try for the future month as 0
DI Impact Actual Running Total = CALCULATE(
SUM ('DI Impact'[DI Impact]),
FILTER (
ALL ('DI Impact'),'DI Impact'[DI Impact Date] <= MAX ('DI Impact'[DI Impact Date])
&& 'DI Impact'[DI Impact Date] <=today()
&& 'DI Impact'[DI Impact Type]="Actual"
)
)
Or
DI Impact Actual Running Total = CALCULATE(
SUM ('DI Impact'[DI Impact]),
FILTER (
ALL ('Date'),'Date'[Date] <= MAX ('DI Impact'[Date])
&& 'Date'[Date]<=today()
)
,'DI Impact'[DI Impact Type]="Actual"
)
Hi all,
Unfortunately none of these solutions worked 😞 What I ended-up doing:
THanks all for trying to help 🙂
OF
Hi @Anonymous ,
You can try this code to calculate running total without group the values before:
Hi @camargos88 , do you suggest I use this formula for my first or second problem? I'm trying to convert it to make it work 🤔
Unfortunately it still sums everything up for the same month, although only for previous months, not future. Did I do something wrong:
DI Target Running (test) = CALCULATE(
SUMX('DI Impact','DI Impact'[DI Target.DI Target Amount] / CALCULATE(COUNT('DI Impact'[DI Impact Date]))),
FILTER(ALL('DI Impact'[DI Impact Date]),'DI Impact'[DI Impact Date] <= MAX('DI Impact'[DI Impact Date])))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |