Hello, I’m trying to study the SUMMARIZE function. So I found the example bellow, but I don’t know how to execute this code in Power BI or in Excel. Thanks to the experts who can help a beginner!
EVALUATE
SUMMARIZE (
Ā Ā Ā Sales,
Ā Ā Ā Sales[Color],
Ā Ā Ā “Sales”, SUM ( Sales[Amount] ),
Ā Ā Ā “AllColorSales”,
Ā Ā Ā CALCULATE (
Ā Ā Ā Ā Ā Ā Ā SUM ( Sales[Amount] ),Ā
Ā Ā Ā Ā Ā Ā Ā ALL ( Sales[Color] )
Ā Ā Ā Ā ),
Ā Ā Ā “AllSales”,
Ā Ā Ā CALCULATE (
Ā Ā Ā Ā Ā Ā Ā SUM ( Sales[Amount] ),Ā
Ā Ā Ā Ā Ā Ā Ā ALL ( Sales )
Ā Ā Ā )
)
—————————— Robert Lauga ——————————
Audrey Abbey
Member
May 4, 2020 at 10:35 AM
In Power BI, you would create a measure.Ā
Give it a name, then an equals sign, then your code goes after the equal sign.Ā Remove the Evaluate command from the beginning.Ā That is only used if you are running this command from SSMS or similar program.
Like this:
Summarize Example =Ā
SUMMARIZE (
Ā Ā Ā Sales,
Ā Ā Ā Sales[Color],
Ā Ā Ā “Sales”, SUM ( Sales[Amount] ),
Ā Ā Ā “AllColorSales”,
Ā Ā Ā CALCULATE (
Ā Ā Ā Ā Ā Ā Ā SUM ( Sales[Amount] ),Ā
Ā Ā Ā Ā Ā Ā Ā ALL ( Sales[Color] )
Ā Ā Ā Ā ),
Ā Ā Ā “AllSales”,
Ā Ā Ā CALCULATE (
Ā Ā Ā Ā Ā Ā Ā SUM ( Sales[Amount] ),Ā
Ā Ā Ā Ā Ā Ā Ā ALL ( Sales )
Ā Ā Ā )
)
—————————— Audrey Abbey SR. BI Developer/Analyst LeapFrogBI Portland OR —————————— ——————————————-
Xavier Gobert
Member
May 5, 2020 at 2:59 AM
Hi,
The outcome of the SUMMARIZE DAX function is a table so the result should be mapped to a table.
In Power BI, you create a new table by clicking on the button “New table” under the “Modeling” ribbon. Then you just need to copy/paste Your DAX expression: Table Name = Your DAX Expression
You will be able to see the results in the newly created table.
Enjoy
Xavier
—————————— Xavier Gobert Head of Internal Development and BI Tomra Leuven —————————— ——————————————-
Please note:
This action will also remove this member from your connections and send a report to the site admin.
Please allow a few minutes for this process to complete.
Report
You have already reported this .
Welcome to our new site!
Here you will find a wealth of information created for peopleĀ that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!