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
Joseph_Hchaime
Helper III
Helper III

Conditional Formatting on Cell based on two conditions

Hi

 

I have the below data example that I'm trying to apply conditional formatting on but I'm not able to do it. I tried creating two different rules but it didnt work. 

 

Basically I want the same color to show in the background of the cell but for different Values of the Amount column based on the Location chosen. 

 

i.e.
if I chose Location NY, highlight all instances of Amount greater than or equal to 4,000 for values corresponding to that location.

if I chose Location London, highlight all instances of Amount greater than or equal to 10,000 for values corresponding to that location.

if I chose Location Dubai, highlight all instances of Amount greater than or equal to 6,000 for values corresponding to that location.

 

LocationAmount
New York4000
London10000
Dubai6000
  
 Conditional formatting:
Highlight in specific color when Location = NY, amount >=4,000
Highlight in specific color when Location = London, amount >=10,000
Highlight in specific color when Location = Dubai, amount >=6,000
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Joseph_Hchaime you can add a measure for the color and then use that in the conditional formatting:

 

Color = 
VAR __Amount = SUM ( Table[Amount] )
VAR __Location = SELECTEDVALUE ( Table[Location] )
RETURN
SWITCH ( TRUE (),
   __Location = "NY" && __Amount >= 4000, "Green",
   __Location = "London" && __Amount >= 10000, "Red",
   __Location = "Dubai" && __Amount >= 6000, "Yellow"
)

 


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@Joseph_Hchaime can you provide more information? Just saying that it didn't work, it doesn't help. Share some screenshots of what you have done and how you are applying the solution.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Joseph_Hchaime
Helper III
Helper III

How would that work? I tried creating it and adding it as a conditional formatting

rule to the Amount measure. it didnt work

parry2k
Super User
Super User

@Joseph_Hchaime you can add a measure for the color and then use that in the conditional formatting:

 

Color = 
VAR __Amount = SUM ( Table[Amount] )
VAR __Location = SELECTEDVALUE ( Table[Location] )
RETURN
SWITCH ( TRUE (),
   __Location = "NY" && __Amount >= 4000, "Green",
   __Location = "London" && __Amount >= 10000, "Red",
   __Location = "Dubai" && __Amount >= 6000, "Yellow"
)

 


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.