Forum Discussion
Sperling
3 years agoAdvocate II
Measure help
Hi, I'm having issues with an out of stock measure. Currently I have an qty. available to sell measure that is made up of two other measures. One is an qty. in stock measure - shows how much...
- 3 years ago
In trying to debug it by splitting it more up, it turned out to work.
Never tried a measure not working by using VAR.
So in my solution I just divided the DAX presented into 2 individual measures:Out of Stock status =VAR QtyAtS =SUMX(DISTINCT(DimItem[Item Number]),[Quantity available to Sell])RETURNIF(CALCULATE(QtyAtS) <= 0,1,0)Out of Stock count =COUNTROWS(FILTER(DISTINCT(DimItem[Item Number]),[Out of Stock status] = 1))
I then divided the Out of Stock count measure with a distinct count of Item Numbers and it works - a bit confused but at least it works.
scott_henderson
3 years agoHelper II
I'd start by using summarize to summarize your stock by company and product then run your calculations on that table.
https://learn.microsoft.com/en-us/dax/summarize-function-dax