Forum Discussion
Anonymous
5 years agoNot applicable
How to reference columns in a summarised table
I have written the following DAX code for a measure VAR ItemTable = SUMMARIZE(Merge1, Merge1[Item Code], "Occurences", DISTINCTCOUNT(Merge1[Order Id])) VAR Result = SUMX(ItemTable, ItemTable[O...
- Anonymous5 years ago
The (my) problem was more to do with understanding how EVALUATE works. This worked just fine.
DEFINE
VAR ItemTable = SUMMARIZE(Merge1, Merge1[Item Code], "Occurences", DISTINCTCOUNT(Merge1[Order Id]))
EVALUATE
ROW("ResultTable", SUMX(ItemTable, [Occurences]))
Anonymous
5 years agoNot applicable
Got it, this is what you meant
EVALUATE
(
VAR ItemTable = SUMMARIZE(Merge1, Merge1[Item Code], "Occurences", DISTINCTCOUNT(Merge1[Order Id]))
VAR Result = {SUMX(ItemTable, [Occurences])}
RETURN
Result
)
EVALUATE has to return a table! 🙂
Thanks
ERD
Community Champion
5 years agoPut the code between curly brackets to return a single scalar value:
Evaluate
{ code }