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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
arun2001mjl
Helper II
Helper II

Conditional Formatting compare with 2 Columns

Hello Team,

I have mutliple columns in a table, below are the few columns on which i need conditional formatting in Badge Column.

 

Current Badge:

Platinum
Gold
Silver
Bronze

 

Previous Badge:

Platinum
Gold
Silver

Bronze

 

Region

A1
E1
A2

 

User

User1
User2
User3
User4
User5
User6
User7
User8

 

I created a Matrix table in PowerBI and moved all above columns.

Name & Region in Rows

Badge and Previous Badge as Value (First). It looks like below

NameRegionBadgePrev_badge
User1A1Platinum 
User2A1PlatinumSilver
User3E2PlatinumGold
User4E2PlatinumSilver
User5A2Platinum 
User6A2PlatinumGold
User7E2GoldBronze
User8A2SilverBronze

 

Now, i need a conditional formatting on Badges:

If Badge is Platinum and Previous Badge is Blank, then we can color it as Yellow.

If Badge & Previous is Platinum, then we need to color it as white.

If Badge is Platinum & Previous Badge is Silver, Bronze or Gold, then we need to color  it as Green. Like below:

arun2001mjl_0-1687440389631.png

 

We tried creating this in PowerBI, but it is marking green for everything. Please help.

 

Regards

Arun

 

1 ACCEPTED SOLUTION
Kishore_KVN
Super User
Super User

Hello @arun2001mjl , create a measure and then apply that measure in the conditional formatting under field values.

Measure looks as below:

Conditional Formating = 
IF(Prev_Badge = BLANK() && Badge = "Platinum","Yellow",
IF(Prev_Badge = "Platinum" && Badge = "Platinum","White",
IF((Prev_Badge = "Gold"||Prev_Badge = "Silver"||Prev_Badge = "Bronze")&& Badge = "Platinum", "Green", BLANK())))

 

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

View solution in original post

3 REPLIES 3
arun2001mjl
Helper II
Helper II

Thank you. Previous Badge column is calculated column which was vlookedup from another table to the main table. Since it is a calculated column, we are unable to create measure.

No, that shouldnt be the case even on a calculated column you can do that. If you are facing any error can you please share that error and let us know what you are facing. 

Kishore_KVN
Super User
Super User

Hello @arun2001mjl , create a measure and then apply that measure in the conditional formatting under field values.

Measure looks as below:

Conditional Formating = 
IF(Prev_Badge = BLANK() && Badge = "Platinum","Yellow",
IF(Prev_Badge = "Platinum" && Badge = "Platinum","White",
IF((Prev_Badge = "Gold"||Prev_Badge = "Silver"||Prev_Badge = "Bronze")&& Badge = "Platinum", "Green", BLANK())))

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.