Forum Discussion
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.
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 ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- PaulaLFrequent Visitor
- daxCommunity 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 ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.