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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mspbilearner
Regular Visitor

Matrix Visual background color formatting

Hi all

I have a matrix visual with customer segments in rows (retail-chains, wholesalers, mini-markets, cafetarias), product category in columns (fast moving, slow moving, stalled stock) and I have a field and a measure under each product category in columns (1- field is sales_value and 2- A measure which is sum(sales_value).

The second column under each product category is converted into % of row totals to show % of each product category for each customer segment row.

I have a need to apply different background color formatting to the second column which is % of total for each row.

If I simply apply conditional formatting for background color, it will apply the same formatting to all % columns for all product categories.

But I have a need to apply different conditional formatting for each product category separately.

Appreciate help to know how above can be achieved.  Below is more detail for understanding.

Thanks in anticipation.

 fast moving slow moving stalled stock total 
CustSegsales%sales%sales%sales%
retail-chains       100%
wholesalers       100%
mini-markets       100%
cafetarias       100%
total       100%
         
fast moving< 60% Green, 60-70% Yellow, 70-80% Green, Above 80% Blue  
slow moving< 20% Green, 20-30% Yellow, 30-40% Green, Above 40% Blue  
stalled stock< 5% Green, 5-10% Yellow, 10-15% Green, Above 15% Blue  
totalsame color for all rows     

 

 

2 REPLIES 2
mspbilearner
Regular Visitor

Hi PijushRoy

First of all thanks for taking time to look at my question and answer.

The measure I have for % column is same for all product categories, which I converted to % of row total.

As I mentioned in my question, if I simply apply conditional formatting for background color, it will apply the same formatting to all % columns for all product categories.

I already tried your suggestion, but it will apply same formatting to all % columns for all production categories i.e. fast moving, slow moving, stalled stock, total.

But I have a need to apply different conditional formatting for % column under each product category separately.

Appreciate if you can guide how can i apply separate conditional formatting for each % column under each product category.

I have tried to explain what is required in a gried I copied in my initial question.

PijushRoy
Super User
Super User

Hi @mspbilearner 

Please create a measure like

 

FastMovingColor = 
SWITCH(
TRUE(),
SUM(Table[Column])>=80%,"Blue",
SUM(Table[Column])>=70%,"Green",
SUM(Table[Column])>=60%,"Yellow",
"GREEN")

 

Use the measure in below

PijushRoy_0-1709032054724.png

 


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

Thanks
Pijush
Linkedin

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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