Forum Discussion
temuulenchoi
4 years agoFrequent Visitor
Cumulative total between date slicer
Hi there, I am trying to filter a list of cumulative Inventory with a date slicer. It works when I move the "until" side, but when I move the "from" side, it shows wrong numbers. Example "Sale"...
- 4 years ago
temuulenchoi , You should use all as inventory need to build from start
Cumulative Total Inventory=
CALCULATE(
SUM(Sale[InQty])-SUM(Sale[OutQty]),
FILTER(ALL(DateTable[Date]),
DateTable[Date] <= max(DateTable[Date]) && (DateTable[Date]) <= TODAY()))
amitchandak
Super User
4 years agotemuulenchoi , You should use all as inventory need to build from start
Cumulative Total Inventory=
CALCULATE(
SUM(Sale[InQty])-SUM(Sale[OutQty]),
FILTER(ALL(DateTable[Date]),
DateTable[Date] <= max(DateTable[Date]) && (DateTable[Date]) <= TODAY()))
temuulenchoi
4 years agoFrequent Visitor
amitchandak, now I'm trying to count the out of stock dates. Imagine if the inventory was 0 between 2022/07/25 and 2022/07/28, the following measure returns 4.
Days out of stock =
COUNTROWS(
FILTER(
ADDCOLUMNS(
CROSSJOIN( VALUES(DateTable[Date]), VALUES(Sale[Item])),
"Inventory Levels", [Cumulative Total Inventory]),
[Inventory Levels] = 0 && NOT(ISBLANK([Inventory Levels]))))
but if i start the slicer from 2022/07/26 for example, it returns blank. Could you help me with this? Thank you very much in advance!
but if i start the slicer from 2022/07/26 for example, it returns blank. Could you help me with this? Thank you very much in advance!