Forum Discussion
Bokazoit
Post Prodigy
5 years agoAccumulated amount only up til current date
I need to show the amount in finance up til current date. But at the same time I need to show budgets accumulated until end of year.
I use this measure:
Amount (Accumulated) =
VAR MaxAar = MAX(DimDato[År])
VAR MaxDato = MAX(DimDato[Dato])
RETURN
CALCULATE(
SUM(FactFinans[#Bogførtbeløb]),
FILTER(
ALL(DimDato),
DimDato[År] = MaxAar
&& DimDato[Dato] <= MaxDato
))
But also need to show the current budget/estimate for full year:
Nuværende estimat (Akkumuleret) = CALCULATE(
[current estimate],
FILTER(
ALL(DimDato),
DimDato[År] = MAX(DimDato[År])
&& DimDato[Dato] <= MAX(DimDato[Dato])
)
)
Can that be done?
Any help is greatly appreciated
This solved it:
Bogført beløb (Akk. Dags dato) = VAR __MaxYT = MAX(DimDato[År]) var __MaxDT = max(DimDato[Dato]) var __TD = TODAY() var __Rtotal = CALCULATE([Bogført beløb], Filter( All(DimDato), DimDato[År] = __MaxYT && DimDato[Dato] <= __MaxDT) ) RETURN IF (__MaxDT >= EOMONTH(__TD,1), BLANK(), __Rtotal)
2 Replies
- Bokazoit
Post Prodigy
This solved it:
Bogført beløb (Akk. Dags dato) = VAR __MaxYT = MAX(DimDato[År]) var __MaxDT = max(DimDato[Dato]) var __TD = TODAY() var __Rtotal = CALCULATE([Bogført beløb], Filter( All(DimDato), DimDato[År] = __MaxYT && DimDato[Dato] <= __MaxDT) ) RETURN IF (__MaxDT >= EOMONTH(__TD,1), BLANK(), __Rtotal) - v-angzheng-msft
Community Support
Hi, Bokazoit
Can't reproduce your problem, here are some references that may be helpful
https://www.daxpatterns.com/cumulative-total/
https://www.wallstreetmojo.com/power-bi-running-total/
https://www.goodly.co.in/running-total-power-bi/
https://community.powerbi.com/t5/Desktop/Cumulative-Total/td-p/43115
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.