Introducing SUMMARIZECOLUMNS - SQLBI
www.sqlbi.com › articles › introducing-summarizecolumnsJan 12, 2022 · The only safe use of SUMMARIZE is when you do not include additional expressions, and you use SUMMARIZE only to join tables and obtain a result equivalent to a SELECT DISTINCT in SQL language. The SUMMARIZECOLUMNS function produces a very optimized query plan, and you should consider it as a replacement to SUMMARIZE and ADDCOLUMNS/SUMMARIZE pattern.
Best practices using SUMMARIZE and ADDCOLUMNS - SQLBI
www.sqlbi.com › articles › best-practices-usingFeb 14, 2022 · EVALUATE SUMMARIZE ( Store, Store[Country], "Stores", COUNTROWS( Store ) ) If you rewrite this query by simply moving the Stores extended columns out of the SUMMARIZE into an ADDCOLUMNS function, you obtain the following query that produces the wrong result. This is because it returns the number of rows in the entire Store table for each row of the result instead of returning the number of stores for each country.