Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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  ...
  • lbendlin's avatar
    5 years ago
    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);-" )
    )