Forum Discussion

DataSkills's avatar
DataSkills
Resolver I
1 year ago
Solved

Conditional formatting gives incorrect results using % but works with number equivalent

I have a matrix and I am putting icons on the values, based on a measure which works out the % of GT. However, when I use the percent option, I get the wrong results. I have to change to the equivale...
  • Selva-Salimi's avatar
    1 year ago

    Hi DataSkills 

     

    as you select percent in conditional formatting. this will calculate that percentage based on minumum and maximum and then choose the color based on its calculation. so if you yourself calculate the percentage before, it will be better to use numbers.

     

    If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi,Selva-Salimi ,thanks for your concern about this issue.

    Your answer is excellent!
    And I would like to share some additional solutions below.

    Hello,DataSkills .I am glad to help you.
    I tested the suggestion made by Selva-Salimi and found the relevant description in the official documentation for setting the conditional format, which makes it more intuitive to see the difference between percent and number Here is my test:

    M_number = 
    VAR _ExpectIncome=MAX('Sales'[Expected income])
    VAR _ActualIncome=MAX('Sales'[Actual income])
    VAR Diff = ABS(_ActualIncome - _ExpectIncome) / _ExpectIncome
    RETURN
       Diff

     

    Links to related documentation.
    URL:
    Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
    You should use number as a conditional format judgment as you mentioned (using the decimal type)

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

    Best Regards,

    Carson Jian,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.