DAX: Performance Gains via Aliases and Variables
Consider the following DAX snippet:
SWITCH ( TRUE() ,SUM('Internet Sales'[Sales Amount]) > 1000000, "A" ,SUM('Internet Sales'[Sales Amount]) > 100000, "B" ,"C" )
Very straightforward, right? If the sum of sales amount is > 1mm, return “A”… if its between 1mm and 100k, return “B”… otherwise, return “C”.