Forum Discussion
Table as a variable doesn't work
- 5 years ago
Hey Veigar ,
you can filter a calculated table. I don't see why this should not be possible.
The measures you posted in the initial post cannot work. You put variables (VAR) but there is no RETURN. That just doesn't work. Check out the syntax:
But as far as I understand that measure is not working at the moment, right?
I realized you want to do some ABC analysis. Check the article on dax patterns, maybe that will help you:
ABC classification – DAX Patterns
Best regards
Denis
Hey Veigar ,
can you post the whole measure? When you split it that leaves room for interpretation.
Also the last SUM is missing a closing bracket "CALCULATE(SUM(_table[Average]), ALL(_table), ..."
Then what do you return? When you use variables you have to put a RETURN at the end and then tell the measure what you want to return. For example:
YoY% =
VAR Sales = SUM(SalesTable[SalesAmount])
VAR SalesLastYear = CALCULATE ( SUM ( SalesTable[SalesAmount] ), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
RETURN
if(Sales, DIVIDE(Sales – SalesLastYear, Sales))
Hi selimovd, thanks for the answer.
I had a static table and so i cannot use any filter.
So i tried to build this measure. The aim of this measure is to calculate the quantity of the items in "A CLASS". (ABC Analysis).
I wanted to calculate the numbers of A and i tried to add these columns: Cumulated stock, Cumulated percentage, ABC value (Which will be a IF function).