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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Bluestonegemini
New Member

Trying to filter count of hire dates based on relative dates

Hi....I have created a power pivot where I want to count the number of the beginning headcount, number of hires, number of terms, and ending headcount as of that Sunday.  From there, I will pull the same date for the four weeks prior to last week, and then YTD.  I am really struggling with how to write an formula that will take that into account.  

DateYearMonth NumberMonthMMM-YYYYDay Of Week NumberDay Of WeekWeek Start DateWeek End DatePrevious Week Start DatePrevious Week End DateRolling 4 Weeks Start DateRolling 4 Weeks End Date
11/1/2023202311NovemberNov-234Wednesday10/30/202311/5/202310/23/202310/29/202310/2/202310/22/2023
11/2/2023202311NovemberNov-235Thursday10/30/202311/5/202310/23/202310/29/202310/2/202310/22/2023
11/3/2023202311NovemberNov-236Friday10/30/202311/5/202310/23/202310/29/202310/2/202310/22/2023
11/4/2023202311NovemberNov-237Saturday10/30/202311/5/202310/23/202310/29/202310/2/202310/22/2023
11/5/2023202311NovemberNov-231Sunday10/30/202311/5/202310/23/202310/29/202310/2/202310/22/2023
11/6/2023202311NovemberNov-232Monday11/6/202311/12/202310/30/202311/5/202310/9/202310/29/2023
11/7/2023202311NovemberNov-233Tuesday11/6/202311/12/202310/30/202311/5/202310/9/202310/29/2023

I have created a calendar table that calculates the previous week start and end date based on the calendar date.  But when I try to create the below measure, I get an error saying there are too many values.  Any help would be appreciated!

 

=CALCULATE(COUNT(EmployeeTable[Hire/Rehire Date]),FILTER('EmployeeTable'[Hire/Rehire Date],'EmployeeTable'[Hire/Rehire Date]>=MIN('Calendar'[Previous Week Start Date])
&& 'EmployeeTable'[Hire/Rehire Date] <= MAX('Calendar'[Previous Week End Date])))

1 REPLY 1
tackytechtom
Super User
Super User

Hi @Bluestonegemini ,

 

Two quick questions:

1) Is there a relationship in place from your date column in EmployeeTable and the calendar table?

2) Does it work if you remove the MIN and MAX function in the filter part?

 

Let me know, if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors