Forum Discussion
Difference Summarize and Summarizecolumns
Use TopN and want the Total in a tabel sum all the rows in the table by using SUMX.
To Sum I use SUMX together with SUMMARIZE. But prefer to use SUMMARIZECOLUMNS.
For both for a test, I have tried with SUMMARIZE and SUMMARIZECOLUMNS to created a New Table in PBI. The two tables are equal.
Then In a vizualization Table, when I add the SUMX with SUMMARIZE the Visualization still work. When try with SUMX with SUMMARIZECOLUMNS. Error "Couldn't load the data....
Am I doing somthing wrong. Have read about SUMMARIZE and SUMMARIZECOLUMNS. Can't see why it don't work.
Attach two picture. Meassures and the test model.
Thank you.
4 Replies
- AnonymousNot applicable
The book in Purple colour : The Definitive Guide to DAX By Marco and Albero. On page 256. In the Text box:
"You will not use SUMMARIZECOLUMNS in measures, becasue it cannot have outside filter context".
I use SUMMARIZECOLUMNS in SUMX. Is that the reason ? Maybe.
Until now haven't found a solution.
It works with SUMMARIZE.
Thank you for your contribution.
- HankCostnerFrequent Visitor
I had a similar issue and ended up using SUMMARIZE instead of SUMMARIZECOLUMNS to calculate Mean Average Percentage Error (MAPE) at a specific granularity.
https://stackoverflow.com/questions/59843180/incorrect-totals-in-power-bi-table-for-mape
MAPEX = SUMX ( SUMMARIZE ( Forecast, 'Product'[ItemName], 'Calendar'[Year], 'Calendar'[Month] ), [Absolute Percentage Error] )
- Greg_Deckler
Community Champion