Forum Discussion

ronaldbalza2023's avatar
ronaldbalza2023
Continued Contributor
3 years ago
Solved

COLOR FORMATTING - SWITCH STATEMENT

Hi everyone. I am using the switch statement for color formatting with this line of code. However, when it reaches to the same target amount, it doesn't excute the right formatting. What the code doe...
  • TomMartens's avatar
    3 years ago

    Hey ronaldbalza2023 ,

    from my perspective, the formatting measure works perfectly. I use exactly your definition, and this allows me to create the below table visual:

    I created two very simple measures to represent the measures that are used inside the formatting measure:

    Productivity Percentage = AVERAGE( 'Table'[Actual] ) 
    Productivity KPI = AVERAGE( 'Table'[Target] )

    and this one just to create a check inside the table:

    Productivity Percentage 90 = AVERAGE( 'Table'[Target] ) * .9

     

    Maybe, you can create a table showing the measures used inside the formatting measure. Be aware that this value (formatted by the UI) 55.0% does not equal the value 0.5501.

    You need to format (adjust) the measure inside the DAX statement regarding the precision. 

     

    Hopefully, this provides some ideas on how to tackle your challenge.

     

    Regards,
    Tom