Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
5 years ago
Solved

Compare measure to column, conditional formatting

Good afternoon.

I can't calculate so that of an average I calculate it with a target value of a table and I put it in conditional format, I tell you:

I have calculated the average of a series of indicators and in a table I have for some of those indicators a series of target values to see if they are met, I need you to compare the average with the value and tell me if or not it is not met, or a conditional format.

promedio.png

According to the indicator the comparison will be for < or >

Greetings and thanks.

  • Hi Aguirre ,

     

    According to the information I'm seeing you need to do something similar to:

     

    Comparision = IF( [Promedio] < SUM(Table[Objective]), 1, 0)

    I assume your Objective is the column on the model then just use the 1 and the 0 to make your condittional formatting.

  • Hi, Syndicate_Admin 

     

    You could create a measure by the following formula:

    condiional =
    IF ( MAX ( 'Table'[Promedio] ) < 'Table'[Objetivo2], "Green", "Red" )

    Then apply conditional formatting: you could choose the background or font color.


    The final output is shown below:

    If it does not make sense, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

     

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

8 Replies

  • Hi Aguirre ,

     

    According to the information I'm seeing you need to do something similar to:

     

    Comparision = IF( [Promedio] < SUM(Table[Objective]), 1, 0)

    I assume your Objective is the column on the model then just use the 1 and the 0 to make your condittional formatting.

    • Aguirre's avatar
      Aguirre
      Icon for Helper IV rankHelper IV

      Hi and thanks for the answer.
      Several problems, I have empty cells and in this way I would put them as a 0, and then according to the field the comparison varies, it could be <or>, I am thinking of adding an additional column to control that.

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Icon for Administrator rankAdministrator

      Hello and thank you for the answer.
      Several problems, I have empty cells and this way I would put them as a 0, and then as the field varies the comparison, it could be <o>, I'm thinking of adding an additional column to control that.

      • MFelix's avatar
        MFelix
        Icon for Super User rankSuper User

        You can control that on the IF measure itself.

         

        Can you share a small sample and expected result for each line?

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, Syndicate_Admin 

     

    You could create a measure by the following formula:

    condiional =
    IF ( MAX ( 'Table'[Promedio] ) < 'Table'[Objetivo2], "Green", "Red" )

    Then apply conditional formatting: you could choose the background or font color.


    The final output is shown below:

    If it does not make sense, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

     

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

    • Thiago_bs01's avatar
      Thiago_bs01
      New Member

      Using the same exemple. How can I do a conditional formatting comparing promedio's avarege and objetivo's avarege? 

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support
    Hi,
    Could you tell me if your problem has been solved?
    If it is, kindly Accept it as the solution. More people will benefit from it.
    Or you are still confused about it, please provide me with more details about your problem