Forum Discussion
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.
2 Replies
- parry2kSuper 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
- AnonymousNot 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:
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:
4.The result is as follows:
Best Regards,
ZhuIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.