Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PaulaL
Frequent Visitor

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. 

 

 
1 ACCEPTED SOLUTION
dax
Community Support
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.

View solution in original post

3 REPLIES 3
PaulaL
Frequent Visitor

Example.JPG

dax
Community Support
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
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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors