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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! 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
Super User
Super User

@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
Super User
Super User

@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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors