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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
avp115
New Member

Conditional Formatting Matrix Table - Reflecting Percentages within Customer Territories

I have a matrix table that I'm looking to organize with conditional formatting (that way customers stand out for the right category). In this case, I want to show that customers in Fort Myers Area have greater likelihood of being in the wealthier category, or that customers in Sarasota have lower likelihood of being in the lowest income bracket, etc.

Currently, it's being organized by a gradient based on distinct count of cust_acct_num, so I'm seeing the more populous market areas highlighted, whereas what I want to highlight would be at a row-by-row level.

I've exhausted a number of possible solutions. My best guess would be to calculate an index based on the proportions I'm using for conditional formatting, like so:

Household Income Range Broward Fort Myers Area Melbourne/Daytona Beach Miami-Dade Other Sarasota Area WPB-Ft Pierce Area

Less than $25k1.060.701.071.300.930.720.95
$25k to less than $50k1.040.841.171.070.921.101.15
$50k to less than $75k1.030.871.161.080.981.170.97
$75k to less than $100k1.010.931.080.931.011.011.00
$100k to less than $150k1.060.921.010.901.141.001.01
$150k to less than $250k1.010.970.890.901.111.151.09
$250k+0.881.250.770.930.971.091.16



I'm not really sure how to do that with measures though! Please let me know if you have any solutions or work-arounds.

Household Income Range (Conditional Formatting).png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @avp115 ,

 

Do you want to do Conditional Format by following the value of measure (each value/grouped column total)?

 

Not quite sure about the logic of calculating Column total, you can create a meausure:

DIVIDE(
    MAX('Table'[Value]), Column total)

Then by selecting [meausre] in the background color

 

vyangliumsft_0-1722585156440.png

vyangliumsft_1-1722585156445.png

If the results above don't meet your expectations, Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

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

4 REPLIES 4
Anonymous
Not applicable

Hi  @avp115 ,

 

Do you want to do Conditional Format by following the value of measure (each value/grouped column total)?

 

Not quite sure about the logic of calculating Column total, you can create a meausure:

DIVIDE(
    MAX('Table'[Value]), Column total)

Then by selecting [meausre] in the background color

 

vyangliumsft_0-1722585156440.png

vyangliumsft_1-1722585156445.png

If the results above don't meet your expectations, Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Thanks for the reply from @FreemanZ , please allow me to provide another insight: 
Hi  @avp115 ,

Do you mean that the values of the matrix are color graded by Column.

 

Here are the steps you can follow:

1. In Power Query – Copy Table – Deleting other columns.

vyangliumsft_0-1722481193556.png

Remove Duplicates – [Group]

vyangliumsft_1-1722481193559.png

Add Column – Index Column – From 1.

vyangliumsft_2-1722481219611.png

2. Joining two tables.

vyangliumsft_3-1722481219612.png

 

Set the Backgroup color to the following:

 

vyangliumsft_4-1722481237780.png

3. Result:

 

vyangliumsft_5-1722481237788.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hello, thank you Liu. The index table is to be calculated using measures (or a combined singular measure).

You will notice for West Palm Beach, for example, that I have calculated 116% based on 12% / 10% (ignoring rounding errors), or for Melbourne/Daytona Beach, 77% comes from 8% / 10% (column total within DMA divided by column total among all). I'm not sure how to configure this matrix using calculations in PowerBI. I can do so in excel rather easily by referencing the right cells.

Again, my goal is to create a gradient conditional formatting for displaying the original data, except having the higher index values show blue, with light gray for lower indexed values.



FreemanZ
Super User
Super User

hi @avp115 ,

 

try to apply conditional formatting for the background with a measure like:
measure =
SWITCH(
    MAX( tablename[area]),
    "Fort Myers", "Red",
    "Sarasota", "Green"  
)

 

for more info:

https://community.fabric.microsoft.com/t5/Community-Blog/Conditional-Formatting-Using-Custom-Measure...

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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