Forum Discussion

PaulaL's avatar
PaulaL
Frequent Visitor
6 years ago
Solved

Colour Formatting based on a measure

I was just wondering if anyone could provide any advice in regards to Conditional Formatting with a measure as I am almost getting the correct results but I dont know if the decimal is the issue.

 

My Code is as follows:

Formatting = SWICTHTRUE() [Column B] = [Column A],2, [Column B] > [Column A],1,0)

 

My issue appears to be when the two columns have the same value e.g. 0.28 I would like this to highlight yellow as its a matching figure but its picking it up as a value which is less and therefore displaying it as red. 

 

 
  • dax's avatar
    dax
    6 years ago

    Hi PaulaL,

    This is caused the real data which might be 0.281, it will use real data to compare instead of use transformation data. So if you want to achieve your goal, you could try to use below measure on conditional formatting

     

    Measure = var A=ROUND(MIN('Table'[column A]),2) var B=ROUND(MIN('Table'[column B]),2) return SWITCH(TRUE(),a=b,"#D6D94C",a<b,"#F5BCF7","#8FEBE9")

     

     

    Best Regards,
    Zoe Zhi

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

3 Replies

    • dax's avatar
      dax
      Community Support

      Hi PaulaL,

      This is caused the real data which might be 0.281, it will use real data to compare instead of use transformation data. So if you want to achieve your goal, you could try to use below measure on conditional formatting

       

      Measure = var A=ROUND(MIN('Table'[column A]),2) var B=ROUND(MIN('Table'[column B]),2) return SWITCH(TRUE(),a=b,"#D6D94C",a<b,"#F5BCF7","#8FEBE9")

       

       

      Best Regards,
      Zoe Zhi

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

      • PaulaL's avatar
        PaulaL
        Frequent Visitor

        dax  thank you very much for your help... I tried the formula and it didnt work but then I split it out into a few steps and all seems to be working correctly now, thank you so much for your help