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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
bansikpopat
Frequent Visitor

Conditional formatting 2 columns to return colour

I have few tables as my data source. I created a table to show various columns from different data sources using table visual. 

 

I want to compare two columns based on certain conditions and in return highlight the cells. 

Here is my sample data : 

 

Table 1 : 

MaterialMaterial NameSales Order
MA01Alpha5123
MA02Bravo5124
1245Charlie5125
MA03Delta5126

 

 

Table 2: 

MaterialStorage locationStock
MA01DE5
MA02DE10
MA03US6
1245NL12

 

 

Table 3 : 

MaterialDelivery quantity 
MA012
MA023
MA031
124510

 

 

Here is the visual I created based on above data : 

New_stock column is created on a column with rule to return values only if the storage location is - DE, NL otherwise return blank. 

 

MaterialNameSales orderNew_StockDelivery quantity 
MA01Alpha512352
MA02Bravo5124103
MA03Delta5126 1
1245Charlie51251210

 

 

I want to highlight the rows with below condtion 

 

If Delivery < 90% of stock return "Yellow" and if Delivery >= 90% of stock then no change in the colour. 

 

Could anyone please support and help? 

 

I have tried IFERROR and LOOKUPVALUE to get the columns in one specific table and then do the conditional colour formatting but does not seem to work. 

 

Any help would be appreciated. Thanks. 

2 REPLIES 2
amitchandak
Super User
Super User

@bansikpopat , you have to create color measure based on these measures you have for Delivery 

 

example

Color =

var _del = divide(sum(Table[Delivery quantity]), sum(Table[New_Stock] ) )

return

if(_del <.9, "Yellow", "white")

 

You can use the same in conditional formatting using the field value option

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

It does not woek when I try to create a new measure. 

My requirement is to compare the delivery quantity and stock quantity. Both of these values are from different tables which are connected using many to many relation. 

 

Example : 

1. I am creating a measure in "Delivery" table to reference 90% stock colum from "Stock" table, but it does not suggest me any column from delivery table. 

bansikpopat_0-1676907955696.png

 

The idea is to basically get the 90% stock and delivery quantity columns in one table to do easier conditional formatting. However, creating new measure to refer columns is not working. 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.