VAR logicTest = COUNTROWS(DISTINCT( FILTER( ALLSELECTED(YEARS[YEAR]), YEARS[YEAR] =2020 ) ) ) = 1 VAR TypeTest = COUNTROWS(DISTINCT( FILTER( ALLSELECTED('Type'[Type]), 'Type'[Type] ="Total ILR" ) ) ) = 1 var adjustType = SELECTEDVALUE('include cat'[Type]) return IF( AND(logicTest,TypeTest), SWITCH(adjustType, "Including CATs", CALCULATE( 'Total ILR'[Total ILR], final_data[yoa_attrition] = "2020"), "Excluding CATs", CALCULATE( 'Total ILR'[ILR (excl. cat)], final_data[yoa_attrition] = "2020"), "Excluding Specifics", CALCULATE( 'Total ILR'[Total ILR], final_data[yoa_attrition] = "2020")), BLANK() )