Forum Discussion
sandeepsingh
6 years agoFrequent Visitor
Does ALL function accept table variable?
HI, I tried to create a table in dax using the below code, I am getting a error message : 'The ALL function expects a table reference for argument '1', but a table expression was used.' Am I miss...
sandeepsingh
6 years agoFrequent Visitor
Honestly, I am building a complex dax query, wherein I am creating a table using summarize and add columns, I have stored the resultant table in a variable. But when I using the stored table variable again, I m getting the table expression error. ALL does not accept table variable, and what does actually is difference between table expression and a table reference.
AntrikshSharma
6 years agoCommunity Champion
I think that is because variables are static and when you store a value/table in a variable it is stored once it is evaluated and post that you can not change its contents,
- sandeepsingh6 years agoFrequent Visitor
I found the solution in the DAX documentation - 'The argument to the ALL function must be either a reference to a base table or a reference to a base column. You cannot use table expressions or column expressions with the ALL function.' So that the column has to be physically present in the model.