Forum Discussion
Adding conditional formatting to a matrix.
- 3 years ago
Hey jamoroso ,
this measure is almost creating what you are looking for:
vizAid Icon = var currentValue = [Originations] var currentColumnContext = SELECTEDVALUE( 'Loans'[LoanCreditScore (groups)] ) var greencheckmark = "CircleSymbolHigh" var redCircle = "CircleSymbolLow" return SWITCH( currentColumnContext , "A+ & A" , var upperbound = 0.5 return IF( currentValue >= upperbound , greencheckmark , redCircle ) , "B & C" , var upperbound = 0.4 var lowerbound = 0.3 return IF( currentValue >= lowerbound && currentValue <= upperbound , greencheckmark , redCircle ) , "D & E & No Score" , var upperbound = 0.2 return IF( currentValue <= upperbound , greencheckmark , redCircle ) )Here is the matrix visual after I added the measure to the Cell elements for the Icon formatting:
You have to adjust the lowerbound and upperbound values though.
This approach is based on a measure that returns an icon. I'm using two of the default icocns, if you want to use exactly the icons from your example, then you have to add the icons.
Here you will find an explanation of how to create measures that return icons: https://radacad.com/power-bi-icon-names-for-conditional-formatting-using-dax
And this video explains how to add custom icons/KPIs based on svg images: https://www.youtube.com/watch?v=z7eyZM2b4Z8Hopefully, this helps what you are looking for.
Regards,
Tom
Hey jamoroso ,
it was a good idea to group values using a "new" column in the same table, basically this is how dimensional modeling works.
Consider uploading your pbix and the spreadsheets to one of the larger file shares like onedrive, googledrive, or dropbox and share the link. Make sure that we can download the files w/o to login.
Regards,
Tom
I did upload my report and spreadsheets to WeTransfer. I put that in my original post. Did I do it wrong? This is the link. https://we.tl/t-SgRTAjKx9w
- TomMartens3 years ago
Super User
Hey jamoroso , you did not, but I do not download from any other cloudstore I mentioned in my post above. One of the reason: https://www.google.com/search?q=wetransfer+malware&rlz=1C5CHFA_enDE1061DE1061&oq=wetransfer+malware&aqs=chrome..69i57j0i390i650l4.16325j0j7&sourceid=chrome&ie=UTF-8
Regards,
Tom
- jamoroso3 years ago
Helper I