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
binayjethwa
Helper IV
Helper IV

Backgroung gradient color conditional formatting for Row comparison for Matrix visual.

Hi,

 

I have a matrix visual which has following items,.

Rows : Domain 

Columns : Name

Values : Measure

 

Column Name has multiple values like , total completions , completion % , Novice , Aspiring , Developing ,Proficient and advanced etc.

 

Below is the matrix view i am having. Now i want to make the comparision based on row level for Novice , Aspiring , Developing ,Proficient and advanced fields only and change background  as Gradient color based on %.

 

For Example in below , For Cisco , Highest is Proficient , so it will have darker background color and similarly the gradient will get to lower color for corresponding lower % for Novice , Aspiring , Developing ,Proficient and advanced only. something like below screenshot.

 

Is there any wasy we can achieve this using dax to compare row level data and change background color as gradient.

 

Measure = VAR Selected = SELECTEDVALUE(Benchmark[Name])

return

SWITCH(TRUE(),

selected = "Skill Benchmark Accesses",ROUND([Skill Benchmark Accesses],0),

selected = "Skill Benchmark Completed %",FORMAT([Completions % for Skillbenchmark],"0%"),

selected="Novice",FORMAT([Novice],"0%"),

selected="Aspiring",FORMAT([Aspiring],"0%"),

selected="Developing",FORMAT([Developing],"0%"),

selected="Proficient",FORMAT([Proficient],"0%"),

selected="Advanced",FORMAT([Advanced],"0%"))

 

 

Thanks in Advance.

binayjethwa_1-1729788302614.png

 

 

 

binayjethwa_0-1729787998651.png

 

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from parry2k.

 

Hi @binayjethwa ,

 

Based on your description I created simple data and achieved the desired results, here are my steps:

1.Create simple data:

vlinhuizhmsft_0-1730178829167.png

2.Create a measure, the values on the matrix can be ranked using RANKX:

color = 
VAR _rank=IF(MAX('Table'[Name]) IN {"Advanced","Aspiring","Novice"},RANKX(FILTER(ALLEXCEPT('Table','Table'[Domain]),'Table'[Name] IN {"Advanced","Aspiring","Novice"}),[measure]))
RETURN
SWITCH(_rank,1,"#4A4A4A",2,"#808080",3,"#D3D3D3")

 

3.Conditional formatting of the measure:

vlinhuizhmsft_1-1730179073499.png

vlinhuizhmsft_2-1730179172627.png

4.The result is as follows:

vlinhuizhmsft_3-1730179219410.png

 

Best Regards,
Zhu

 

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

parry2k
Super User
Super User

@binayjethwa you can take some help from these videos and tweak the solution as you see fit:

 

Developing Custom Gradient Color Scales for Columns in Matrix Visuals in Power BI: Part 1

How to create your own color gradient scale for each column in a matrix visual - Part 2

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.