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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.