Forum Discussion
dfox09
Helper III
4 years agoSet the default value for slicer to 0
Here is the DAX for a Slicer that I am using to show revenue amount based on a carrier selected. If no carrier is selected, ir shows the total value for all of the carriers. How do I get the default ...
- 4 years ago
Hi dfox09 ,
You can try this:-
measure = VAR result = CALCULATE ( MAXX ( 'FactRFP', [Total Annual Premium & FeesCURRENT] ), REMOVEFILTERS ( 'DimCarrier' ) ) RETURN COALESCE ( result, 0 ) --or you can try below --if(result = blank(),0,result) --or --result+0Thanks,
Samarth
Samarth_18
Community Champion
4 years agodfox09 Based on sevenhills suggestion below would be your ideal code:-
measure =
VAR _ValueCalculated =
CALCULATE (
MAXX ( 'FactRFP', [Total Annual Premium & FeesCURRENT] ),
REMOVEFILTERS ( 'DimCarrier' )
)
RETURN
IF ( ISFILTERED ( DimCarrier[Carrier] ), _ValueCalculated, 0 )dfox09
Helper III
4 years agoThat worked! Thank for your suggestion. I will note this and the one you suggested below.