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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
lprabhal
Frequent Visitor

Color Coding based on a dimension in a matrix

Hi Everyone,

  I started using Power BI from 2-3days. I am trying to create a report with Matrix. 

  I have taken date(as weeks in columns) and Names in Rows and field1(a dimension basically) and field2(Measure)  in Values. 

  Now i want to color the report based on field1.

  Field1 is having values like this:: a,b,c,d, general etc., 

  If a then 'Green'

  else if b then 'Light Green'

  else if c then 'Red'

  else if d then 'Blue' 

  else 'yellow'

But so far i have seen field1 is taking to summarization and so if i go for conditional formatting i couldn't take as a proper dimension rather it is giving me first/last/count/countd. I couldnt de summarize it and apply color here.

Is there any way that i can apply color to my cells based on the dimension values in a matrix format. 

 

 

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @lprabhal 

I would suggest you add an index column in query editor and drag it in matrix.Then create a measure and use it in conditional formatting.

 

Measure = SWITCH(MAX(Table1[filed1]),"a",1,"b",2,"c",3,"d",4,5)

1.png

Regards,

Community Support Team _ Cherie Chen
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

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @lprabhal 

I would suggest you add an index column in query editor and drag it in matrix.Then create a measure and use it in conditional formatting.

 

Measure = SWITCH(MAX(Table1[filed1]),"a",1,"b",2,"c",3,"d",4,5)

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.