Forum Discussion
Switch syntax causing issues with loading visuals
- 5 years ago
That measure (and the one it references) might need more optimization but for starters, you can use a variable like this to reduce to amount of re-calculation.
Suppress Sales Switch =
VAR Suppress = [Suppress Sales]
RETURN
SWITCH (
SELECTEDVALUE ( 'Total Sales Slicer'[Total Sales Criteria] ),
"Total Sales = 0", IF ( Suppress = 0, Suppress, BLANK () ),
"Total Sales < 0", IF ( Suppress < 0, Suppress, BLANK () ),
"Total Sales > 0", IF ( Suppress > 0, Suppress, BLANK () ),
"Total Sales <> 0", IF ( Suppress <> 0, Suppress, BLANK () ),
Suppress
)Pat
That measure (and the one it references) might need more optimization but for starters, you can use a variable like this to reduce to amount of re-calculation.
Suppress Sales Switch =
VAR Suppress = [Suppress Sales]
RETURN
SWITCH (
SELECTEDVALUE ( 'Total Sales Slicer'[Total Sales Criteria] ),
"Total Sales = 0", IF ( Suppress = 0, Suppress, BLANK () ),
"Total Sales < 0", IF ( Suppress < 0, Suppress, BLANK () ),
"Total Sales > 0", IF ( Suppress > 0, Suppress, BLANK () ),
"Total Sales <> 0", IF ( Suppress <> 0, Suppress, BLANK () ),
Suppress
)
Pat
- Vinod_V_125 years agoFrequent Visitor
Thanks very much for the response Pat. This is brilliant.