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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
andreaslemp
Frequent Visitor

Conditional Formatting Latest Value Based on Slicer Selections

I have a KPI visual showing average days to hire and slicers by facility and date. The conditional formatting is not working if multiple dates or facilities are selected. I feel like this should be a simple DAX code, but I can’t seem to figure out the right syntax. It appears the color is based off the total or last record, rather than slicer selections.

Here is the data I’m using (there is more in the full table).

andreaslemp_0-1718204255335.png

 

This is the KPI visual I’m using:

andreaslemp_1-1718204255337.png

 

As you can see for this KPI with all facilities and dates selected the color appears to work, but I think it is coincidence. If I filter for a specific facility (i.e., OHBH), it shows green but should be yellow, and the table when filtered shows all facilities but has blanks in the Average Days to Hire column.

andreaslemp_0-1718204786611.png

 

And here is the KPI when filtered, as you can see it’s green which aligns with the Total value in the table and the last facility (that is excluded from the filter), rather than the most recent date of April 2024 for OHBH. Should be yellow.

andreaslemp_1-1718204797434.png

 

When filtered for only April, the color in the KPI visual works.

andreaslemp_2-1718204806538.png

 

Average Days to Hire Measure:

andreaslemp_3-1718204815119.png

 

RYG Days to Hire Measure:

andreaslemp_4-1718204821417.png

 

Using RYG Days to Hire in KPI Visual Conditional Formatting (used in all: Good, Neutral, & Bad color):

andreaslemp_5-1718204827842.png

Initially tried using rules for conditional formatting off of the Average Days to Hire, but that didn’t work either.

andreaslemp_6-1718204837182.png

 

Thanks for taking the time to review.

1 REPLY 1
Anonymous
Not applicable

Hi @andreaslemp ,

Base on your description, it seems like the conditional formatting on KPI visual is not working when select multiple months. However, it works well when select single month. Could you please provide some raw data in your table 'Days to Hire_Drilldown' (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.