Forum Discussion
Summing forward and backwards
- Anonymous5 years ago
Hi STS_Joshua ,
Please try to create a measure as below:
Fin = IF ( MAX ( 'Date'[Date] ) = DATE ( 2019, 8, 1 ), //Start date: 2019/08/01 12, //Initial Fin: 12 12 + CALCULATE ( SUM ( 'Inputs'[Ins] ), FILTER ( 'Inputs', 'Inputs'[Date] <= MAX ( 'Date'[Date] ) && 'Inputs'[Date] > DATE ( 2019, 8, 1 ) ) ) - CALCULATE ( SUM ( 'Outputs'[Outs] ), FILTER ( 'Outputs', 'Outputs'[Date] <= MAX ( 'Date'[Date] ) && 'Outputs'[Date] > DATE ( 2019, 8, 1 ) ) ) )If the above measure can't get your desired result, please provide some sample data of table Inputs and Outputs and your desired result with example. Thank you.
Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
Apologies, I should have been more explicit. 10 would be the value to start October with therefore it should be the final value for September. All of the month values are measures which are sums from their own respective tables like so:
Ins = SUM('Inputs'[Ins])
Outs = SUM('Outputs'[Outs])
The dates are a date table setup like so:
Dates = CALENDAR(FIRSTDATE('Inputs'[date]),LASTDATE('Inputs'[date]))
Final would then be a measure taking into account the Ins, Outs, and Current Inventory level that then works forward and back from the current Inventory because I have historical/projected ins and outs in their own respective tables.
Hi STS_Joshua ,
Please try to create a measure as below:
Fin =
IF (
MAX ( 'Date'[Date] ) = DATE ( 2019, 8, 1 ), //Start date: 2019/08/01
12, //Initial Fin: 12
12
+ CALCULATE (
SUM ( 'Inputs'[Ins] ),
FILTER (
'Inputs',
'Inputs'[Date] <= MAX ( 'Date'[Date] )
&& 'Inputs'[Date] > DATE ( 2019, 8, 1 )
)
)
- CALCULATE (
SUM ( 'Outputs'[Outs] ),
FILTER (
'Outputs',
'Outputs'[Date] <= MAX ( 'Date'[Date] )
&& 'Outputs'[Date] > DATE ( 2019, 8, 1 )
)
)
)
If the above measure can't get your desired result, please provide some sample data of table Inputs and Outputs and your desired result with example. Thank you.
Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.