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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Individual background color for each column in a matrix

Hi Experts

 

I have created a matrix in Power BI. In columns I have used sub category. Now I have a requirement to display each column with different colors irrespecive of the values in it.

 

ie : Appliances column should show light green color vertically from its header to last value. Similarly another color for next column.

 

I  tried background colors and different scenario's. Nothing helped. Can anyone let me know if my requirement can be done in power BI?

 

upload.PNG

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Yes, usually you add calculated columns (sometimes also measures) to your data that contain the color code that corresponds to your condition (in the above case the product category column). Then you can apply conditional formatting "based on field value"

 

BG = if(Sales[Product]="Chairs","Red","White")
 
lbendlin_0-1622316676428.png

 

lbendlin_1-1622316856198.png

You can see some issues here - the totals are colored but the column header is not.  While you can fix the former, the latter is not yet something you can do dynamically (it's on the roadmap).

 
 

 

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Yes, usually you add calculated columns (sometimes also measures) to your data that contain the color code that corresponds to your condition (in the above case the product category column). Then you can apply conditional formatting "based on field value"

 

BG = if(Sales[Product]="Chairs","Red","White")
 
lbendlin_0-1622316676428.png

 

lbendlin_1-1622316856198.png

You can see some issues here - the totals are colored but the column header is not.  While you can fix the former, the latter is not yet something you can do dynamically (it's on the roadmap).

 
 

 

Anonymous
Not applicable

I can ignore hearer coloring. Thank you. It worked for values. 

 

I tried to fill blanks with 0 in same matrix. But the colors didn't apply to zero's. Is there a way to do that one too?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.