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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PowerBInewbie92
Regular Visitor

IF Statements with slicers

Hi!

 

I'm new to DAX and I've been struggling to get my IF statement to calculate correctly once a slicer selection has been made.

 

I have two main sources of data and both are linked by the individual's email address.:

 

  1. List of dates/times associated to individuals log ins across the period of a month
  2. List of no. days they should have logged in 

The IF statement I am trying is: 

IF('Employee record'[No. days required]<[Count No. log in],"Yes","No")
 
This works fine until a date range is selected on the log in date slicer. It continues to calculate based on the original value, not the new filtered value. 
 
The 'Employee record'[No. days required] is static data but the [Count No. log in] is a calculated column which is:
 
IF(ISFILTERED('Single count log in'[Log in date]),COUNTROWS('Single count log in'),"Unfiltered") - I have also tried this without the isfiltered element and just counting the rows of that column and the same issue occurs.
 
How do I get the IF statement to re-adjut based on the slicer selection?
 
Thank you!
 
 
1 REPLY 1
Ritaf1983
Super User
Super User

Hi @PowerBInewbie92 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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