Forum Discussion
Anonymous
7 years agoNot applicable
Calculate table - aggragation
I need to create an aggragated table based on a table within my Power BI app. Basically I have the following fields in the base tablein my Power BI app: Company Revenue Sale Date I want t...
LivioLanzo
Solution Sage
7 years agoAnonymous
=
SUMMARIZECOLUMNS(
Sales[Company],
"SaleAmount", SUM( Sales[Revenue] ),
"LastDate", MAX( Sales[Sale Date] )
)Anonymous
7 years agoNot applicable
Sorry - left out one question. How do I add a filter to your expression - say I only want company Sales from the "East" region?
- LivioLanzo7 years ago
Solution Sage
Anonymous
You have different Table function within DAX, CALCULATETABLE and SUMMARIZECOLUMNS are just two of them.
If your region column is within your sales table then you can do:
= CALCULATETABLE( SUMMARIZECOLUMNS( Sales[Company], "SaleAmount", SUM( Sales[Revenue] ), "LastDate", MAX( Sales[Sale Date] ) ), Sales[Region] = "East" )