Adding columns to the SUMMARIZE function
In this recipe, you will extend the last calculation to add an additional column to the output. You can summarize the data by including more columns in the SUMMARIZE
function to achieve your desired output.
Getting ready
Complete the calculation in the Using the SUMMARIZE function recipe.
How to do it...
- Connect to the CHAPTER_9_DAX database in SQL Server Management Studio.
- Right-click on the database, and select New Query | MDX to create a new MDX query window.
- To determine the number of fatalities by the manner of the crash combined with the weather condition, you will use the
SUMMARIZE
function along with theEVALUATE
function to return a table:EVALUATE SUMMARIZE ( CRASH_DATA_T ,Manner_of_Crash[Manner_Group] ,WEATHER_T[WEATHER_CONDITION] ,"Total Fatalities" , SUM('CRASH_DATA_T'.[FATALITIES]) )
- Then press F5 to run the query.