Forum Discussion
Dynamic Calculation of weekly Total
Hi dirkkoch ,
If you are using measure, please try to use the following measure:
Total number = IF(measure2 Inbound = "0" && measure3 Outbound="0",
CALCULATE(measure1 No.of Parts, FILTER('Calendar',Date[Date]<=TODAY()))+
CALCULATE(measure2 Inbound, FILTER('Calendar',Date[Date]<=MAX(Date[Date])))-CALCULATE(measure3 Outbound, FILTER('Calendar',Date[Date]<=MAX(Date[Date])))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
v-deddai1-msft
I think we are getting closer to a solution. If I use your formula with my measures, then I only receive the difference/delta between inbound & outbound, meaning the sum of 31 is not set as a starting value for further calculation (see Screenshot 1)
Total number = If([Anzahl Motoren Inbound]=VALUE("0") && [Anzahl Motoren Outbound]=Value("0"), Blank(),
Calculate([Anzahl Motoren SGZ neu], FILTER(Kalender, Kalender[Datum]<=Today()))+
Calculate([Anzahl Motoren Inbound], Filter(Kalender, Kalender[Datum]<=Max(Kalender[Datum])))-
Calculate([Anzahl Motoren Outbound], Filter(Kalender, Kalender[Datum]<=Max(Kalender[Datum]))))
The closest I get is when I use the following DAX calculation, unfortunately in this case the sum of 31 is taken as input for each future week and not only for the current week:
Total number = If([Anzahl Motoren Inbound]=VALUE("0") && [Anzahl Motoren Outbound]=Value("0"), Blank(),
Calculate([Anzahl Motoren SGZ], ALLEXCEPT(Kalender, Kalender[Datum]))+
Calculate([Anzahl Motoren Inbound], Filter(Kalender, Kalender[Datum]<=Max(Kalender[Datum])))-
Calculate([Anzahl Motoren Outbound], Filter(Kalender, Kalender[Datum]<=Max(Kalender[Datum]))))