Forum Discussion
Running total within time periods
- 7 years ago
Hi MMJ369,
Is it this one? Please check out the demo in the attachment.
PlacedOrdersThisMonth 3 = CALCULATE ( IF ( MIN ( 'Calendar'[Date] ) = MIN ( OB[CutOffDate] ), 0, SUM ( OB[OrderValue] ) ), USERELATIONSHIP ( OB[OrderDate], 'Calendar'[Date] ), FILTER ( OB, OB[ShipDate] <= OB[CutOffDate] ) )Best Regards,
Dale
I now have the calculation and graph to show only orders which can be shipped before cutoff date of that order by amending the measure:
PlacedOrdersThisMonth =
CALCULATE (
SUM ( OB[OrderValue] ),
USERELATIONSHIP ( OB[OrderDate], 'Calendar'[Date]),
FILTER(OB, OB[ShipDate] <= OB[CutOffDate] )
)
This gives the graph:
where the red orders are not shown as these are shipped after cutoff.
The issue which I have left then is that the cumulative value is calculated for all orders, where I would like to start from zero value after each cutoff date. How could I achieve that?
- v-jiascu-msft7 years ago
Microsoft Employee
Hi MMJ369,
Is it this one? Please check out the demo in the attachment.
PlacedOrdersThisMonth 3 = CALCULATE ( IF ( MIN ( 'Calendar'[Date] ) = MIN ( OB[CutOffDate] ), 0, SUM ( OB[OrderValue] ) ), USERELATIONSHIP ( OB[OrderDate], 'Calendar'[Date] ), FILTER ( OB, OB[ShipDate] <= OB[CutOffDate] ) )Best Regards,
Dale