Forum Discussion
Date math problem: if (ExpectedDate<=date, QTY, 0)
- 9 years ago
Try this slight modification...
Cumulative Incoming = CALCULATE( SUM(Incoming[Incoming Qty]) , FILTER( ALLSELECTED('Incoming'), 'Incoming'[Incoming Date]<=MAX('Dates'[Date]) ) )
Sounds like you are just after a cumulative measure similar to this :
Cumulative Incoming = CALCULATE(
SUM(Incoming[Incoming Qty]) ,
FILTER(
ALL('Incoming'),
'Incoming'[Incoming Date]<=MAX('Dates'[Date])
)
)I have a PBIX file you can try it with here https://1drv.ms/u/s!AtDlC2rep7a-kHTghFw8Upt_GDbN
Awesome! So I have this:
IncomingQTYCumulative = CALCULATE(SUM(IncomingInventories[order_qty]),FILTER(ALL(IncomingInventories),'IncomingInventories'[expected_date]<=MAX('Date'[Date])))
And while it works perfectly, these inventory numbers are by Item_ID, relating to 'item[Item_id] and this measure is immune to slicers tied to the Item table. I know why, because of the ALL(IncomingInventories), but I need to be able to slice by 'Item[Stat_ID].
I can hardcode it into the measure, but that is not a good solution. How can I allow the slicer to carry through?
Thanx
- Phil_Seamark9 years agoMicrosoft Employee
Try this slight modification...
Cumulative Incoming = CALCULATE( SUM(Incoming[Incoming Qty]) , FILTER( ALLSELECTED('Incoming'), 'Incoming'[Incoming Date]<=MAX('Dates'[Date]) ) )- psmith-nhs-inc9 years agoHelper III
That seems to work perfectly. Thank you very much!