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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Conditional Formatting Not Getting Applied on all Cells In matrix

Hi Team 

 

I have Created a Measure to Apply  Conditional Formatting According to Quartile But It is not Working On all Values.

 

across_colour = var quartile = SELECTEDVALUE('Dax Groupby'[RAP_Quartile_accross])

return
SWITCH(true(), quartile = "Q1" ,"#A0FE93", quartile = "Q2","#E7FAAC",quartile = "Q3","#E66C37",quartile = "Q4", "#FE9393")
 
within_colour = var quartile = SELECTEDVALUE('Dax Groupby'[RAP_Quartiles_within])

return
SWITCH(true(), quartile = "Q1" ,"#A0FE93", quartile = "Q2","#E7FAAC",quartile = "Q3","#E66C37",quartile = "Q4","#FE9393")
 
Attaching Screenshot for your reference.
 
Power BI Forum.PNG

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

Try this, it works for me with my sample data

CF = 

SWITCH(
    
    MIN('Data'[Quartile]),
    
    "Q1" ,"#A0FE93", 
    
    "Q2","#E7FAAC",
    
    "Q3","#E66C37",
    
    "#FE9393"
)

 

cfmat2.pngcfmat1.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

4 REPLIES 4
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

Try this, it works for me with my sample data

CF = 

SWITCH(
    
    MIN('Data'[Quartile]),
    
    "Q1" ,"#A0FE93", 
    
    "Q2","#E7FAAC",
    
    "Q3","#E66C37",
    
    "#FE9393"
)

 

cfmat2.pngcfmat1.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Thanks Phil 

It Works 

Can You Please elaborate why did earlier dax didn't work and this one does

Hi @Anonymous 

 

I can't say for sure without your data but I'd say SELECTEDVALUE wasn't returning what you thought it was.  I used MIN() to get the text value for the quartile.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Thanks

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.