Forum Discussion
Anonymous
5 years agoNot applicable
Switch and If Measure - Tricky Question
Hi Experts See the two measure below. When I use the switch measure it give me only the customer that have values based on channel selection from slicer works but formatting issues..on number ...
- 5 years agoVAR MTDValue =IF(AVERAGE ( Customers_Profitability_Consolidation[Chkfmt] )=1, FORMAT(MthVal, "#,##0.0;(#,##0.0%);-" ), IF(AVERAGE ( Customers_Profitability_Consolidation[Chkfmt] )=2, FORMAT(MthVal, "#,##0.0;(#,##0.0);-" ),FORMAT(MthVal, "#,##0.0;(#,##0.0);-" )))1. you cannot mix values and percentages in the same format command.2. the second option is not neededChange your code toVAR MTDValue =IF(AVERAGE ( Customers_Profitability_Consolidation[Chkfmt] )=1, FORMAT(MthVal, "#,##0.0%;(#,##0.0%);-" ),FORMAT(MthVal, "#,##0.0;(#,##0.0);-" ))
lbendlin
5 years agoSuper User
VAR MTDValue =
IF(
AVERAGE ( Customers_Profitability_Consolidation[Chkfmt] )=
1, FORMAT(MthVal, "#,##0.0;(#,##0.0%);-" ), IF(AVERAGE ( Customers_Profitability_Consolidation[Chkfmt] )=
2, FORMAT(MthVal, "#,##0.0;(#,##0.0);-" ),
FORMAT(MthVal, "#,##0.0;(#,##0.0);-" )
))
1. you cannot mix values and percentages in the same format command.
2. the second option is not needed
Change your code to
VAR MTDValue =
IF(AVERAGE ( Customers_Profitability_Consolidation[Chkfmt] )=1, FORMAT(MthVal, "#,##0.0%;(#,##0.0%);-" )
,FORMAT(MthVal, "#,##0.0;(#,##0.0);-" )
)
- Anonymous5 years agoNot applicable
Many thanks