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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors