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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kcantor
Community Champion
Community Champion

Calculation question - IF statement in Query Editor for Future Date

I have a column of dates. If an employee has left the department, there is an end date that is in the past. If the employee is still in that department, the end date is listed as 12/31/9999 because people here just don't want to leave blanks. (Personal pet peeve). I need to count the number of employee in that department who are current. In other words, I would like to do a DISTINCTCOUNT[EmployeeCode]) where the date is equal to 12/31/9999. My goal is to add this in query editor or as a measure. I have tried:  CALCULATE(DISTINCTCOUNT([EmployeeCode]), [End Date]="12/31/9999")

Being as how I only want the number it is failing due to not using the end date within the matrix. I need the data to appear as:

Dept1      3

Dept2      3

Dept3      2

Dept4      4

 

I am not even a beginner in M





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




1 ACCEPTED SOLUTION
kcantor
Community Champion
Community Champion

Nevermind. I did this:

CALCULATE(COUNTROWS('Pod members'), FILTER('Pod members', [End Date]>TODAY()))





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
kcantor
Community Champion
Community Champion

Nevermind. I did this:

CALCULATE(COUNTROWS('Pod members'), FILTER('Pod members', [End Date]>TODAY()))





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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