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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Matrix conditional format Background color each cell

Hi All,

I am currently looking to conditional format background color of each cell depending on column category & row value using conditions. Is there a way to do it? Please let me know.

 

Thanks

Susheel

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Susheel,
According to your description, it seems that you want to custom cell background color based on some rules, right?
You could try to follow the steps:
1. Create a new measure.
2. Click the visualization ,then go to Fields in Visualizations pane.
3. Right-click or select the down-arrow next to the field in the Values.
4. Select Conditional formatting ,then Background color.
5. In the pop-up window, Select Field value in Format by field and select the created measure in step1 for Based on field.
For example, the following formula applies different color values to Units Sold column, based on the value of Discount Band and Units Sold columns.

 

 

Discount Band color =
SWITCH (
    TRUE (),
    SUM ( financials[Units Sold] ) < 50000
        && SELECTEDVALUE ( financials[Discount Band] ) = "High", "Yellow",
    SUM ( financials[Units Sold] ) > 50000
        && SELECTEDVALUE ( financials[Discount Band] ) = "Low", "Red"
)

 

 
My example table with Units Sold background color based on calculated looks like this:
case pic.png
Is this result what you want? If you have any questions, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
 
Best Regards,
Eyelyn Qin

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi Susheel,
According to your description, it seems that you want to custom cell background color based on some rules, right?
You could try to follow the steps:
1. Create a new measure.
2. Click the visualization ,then go to Fields in Visualizations pane.
3. Right-click or select the down-arrow next to the field in the Values.
4. Select Conditional formatting ,then Background color.
5. In the pop-up window, Select Field value in Format by field and select the created measure in step1 for Based on field.
For example, the following formula applies different color values to Units Sold column, based on the value of Discount Band and Units Sold columns.

 

 

Discount Band color =
SWITCH (
    TRUE (),
    SUM ( financials[Units Sold] ) < 50000
        && SELECTEDVALUE ( financials[Discount Band] ) = "High", "Yellow",
    SUM ( financials[Units Sold] ) > 50000
        && SELECTEDVALUE ( financials[Discount Band] ) = "Low", "Red"
)

 

 
My example table with Units Sold background color based on calculated looks like this:
case pic.png
Is this result what you want? If you have any questions, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
 
Best Regards,
Eyelyn Qin

 

harshnathani
Community Champion
Community Champion

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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