DAX – SUMMARIZE Statement
SUMMARIZE function returns a summary table for the requested totals over a set of groups. Readers familiar with T-SQL SELECT statement, this is the equivalent of writing a query using the GROUP BY clause.
Syntax –
SUMMARIZE(<table>, <groupBy_columnName>[, <name>, <expression>]…)
Demo –
The Following example returns summary of the Internet Sales grouped around Country, Category & Calendar
EVALUATE SUMMARIZE( ‘Internet Sales’,
Geography[Country Region Name],
Product[Product Category Name],
‘Date'[Calendar Year],
“Internet Total Sales”,
‘Internet Sales'[Internet Total Sales])
Notice you do not need to define the relationships between tables when using SUMMARIZE because the relationship is defined in the model.
Output –
Currently I am getting expected output but output is not sorted for sorting I need to use another function – Order By
EVALUATE SUMMARIZE( ‘Internet Sales’,
Geography[Country Region Name],
Product[Product Category Name],
‘Date'[Calendar Year],
“Internet Total Sales”,
‘Internet Sales'[Internet Total Sales])
ORDER BY Geography[Country Region Name], Product[Product Category Name],’Date'[Calendar Year]
Further I can add measure to Order By –EVALUATE SUMMARIZE( ‘Internet Sales’,
Geography[Country Region Name],
Product[Product Category Name],
‘Date'[Calendar Year],
“Internet Total Sales”,
‘Internet Sales'[Internet Total Sales])
ORDER BY Geography[Country Region Name], Product[Product Category Name],’Date'[Calendar Year], ‘Internet Sales'[Internet Total Sales]
http://5000lenenbkr.nl Thanks for that awesome posting. It saved MUCH time 🙂
cover letters Hey there, I simply enjoy your web-site. Very much usefull information and facts. Appreciate it for sharing it with us. Regards!
I drop a comment when I appreciate a article on a site or I have something to add to the conversation. It is caused by the sincerness communicated in the article I looked at. And on this post DAX – SUMMARIZE Statement Karan Gulati | Microsoft BI. I was excited enough to drop a comment 🙂 I actually do have a couple of questions for you if you don’t mind. Is it only me or do a few of the comments appear as if they are coming from brain dead visitors? 😛 And, if you are writing at additional places, I’d like to keep up with you. Could you make a list the complete urls of all your social pages like your linkedin profile, Facebook page or twitter feed?
http://www.facebook.com/pages/Data-Warehouse-Business-Intelligence/189141584512231
https://twitter.com/karangspeaks
http://in.linkedin.com/in/karanspeaks
http://blogs.msdn.com/b/karang/
Stay in touch 😉