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
dbldee5
Frequent Visitor

Conditional Formatting

Hi I am using the following Dax to apply conditional formatting and it is working as I expect it to. 

Where if the PartofTerm Row is above 90% it turns it to Pink

if the Modality is above 90% it turns it to Yellow

if the Course is above 90% it turns it to Red

Color Measure =
SWITCH(
TRUE()
,ISFILTERED(SectionEntollment[PartofTerm]) && [PCTFilled] >= .90, "#FF9999"
,ISFILTERED(SectionEntollment[Modality]) && [PCTFilled] >= .90, "#FFE699"
,ISFILTERED(SectionEntollment[Course]) && [PCTFilled] >= .90, "#C00000"
)

 

 

 

dbldee5_0-1728436771428.png

 

 

The problem I am having is if I filter the table by the PartofTerm or Modality, it loses the Conditional Formatting.

Can anyone help fix this?

 

Thanks

Daryl

1 ACCEPTED SOLUTION
AllisonKennedy
Community Champion
Community Champion

@dbldee5  I think this is due to the way you've used ISFILTERED in your measure. Order matters when using the SWITCH function so your measure will only work for the specific matrix layout in your image, and if you don't filter by modality or part of term (as then you'll lose the conditional formatting on the ones below it in your switch statement).

 

You could try using ISINSCOPE instead of the ISFILTERED, you may need to reverse the order in this case, I'm not certain. I struggle with ISINSCOPE myself and also use ISFILTERED in its place when it makes sense to, but in theory ISINSCOPE should work beautifully here if you get the order right. 🙂 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

1 REPLY 1
AllisonKennedy
Community Champion
Community Champion

@dbldee5  I think this is due to the way you've used ISFILTERED in your measure. Order matters when using the SWITCH function so your measure will only work for the specific matrix layout in your image, and if you don't filter by modality or part of term (as then you'll lose the conditional formatting on the ones below it in your switch statement).

 

You could try using ISINSCOPE instead of the ISFILTERED, you may need to reverse the order in this case, I'm not certain. I struggle with ISINSCOPE myself and also use ISFILTERED in its place when it makes sense to, but in theory ISINSCOPE should work beautifully here if you get the order right. 🙂 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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