Forum Discussion

seigneur101's avatar
seigneur101
New Member
8 years ago
Solved

Nested SUMMARIZE doesn't work with VAR?

Hello everyone!   I came up with a solution to a problem that works, but I am not sure whether it is the best solution. However, regardless of that, I don't understand why one of my many other tria...
  • TomMartens's avatar
    8 years ago

    Hey,

     

    you should just use SUMMARIZE to group rows and add columns using ADDCOLUMNS(...), see here:

    https://www.sqlbi.com/articles/best-practices-using-summarize-and-addcolumns/

     

    Under certain circumstances it's still favorable to use ADDCOLUMNS(SUMMARIZRE(...),...) instead of SUMMARIZECOLUMNS, but the aritcle above is also mentioning this.

     

    Not sure if this will help, but SUMMARIZE is an iterator, meaning maybe you should consider to wrap you expression into a CALCULATE(...) to enforce context transitiont.

     

    Just wondering, without using your sample files

     

    Regards,

    Tom