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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
metcala
Helper III
Helper III

Vacancies over time

Hi all

 

Still pretty new to PowerBI and I am really struggling to create a solution to display vacancies over time. I have a working solution tracking vacancies using today's date however I am looking to build a solution using a date slicer to select any date and look a the position.

 

Current Data Structure

 

Staffing table

EmployeeID/VacancyID (all Employee IDs start with 1)

Name

Team

Role

Start Date

End Date

 

Date table

Date

 

Current Measure

Vacancies

=CALCULATE(
   COUNTA('Staffing'[EmployeeID/VacancyID]),
   FILTER('Staffing',LEFT('Staffing'[EmployeeID/VacancyID],1)<>"1",
   FILTER('Staffing','Staffing'[Start Date]<TODAY() && 'Staffing'[End Date]>TODAY())
)

 

Proposed Solution

I have tried replacing TODAY() with Date[Date] and adding a slicer with the [Date] however that doesn't work.

 

Any help or guidance would be really appreciated!

 

Thanks

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @metcala 

please try

=
VAR SelectedDate =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
COUNTA ( 'Staffing'[EmployeeID/VacancyID] ),
FILTER (
'Staffing',
LEFT ( 'Staffing'[EmployeeID/VacancyID], 1 ) <> "1"
&& 'Staffing'[Start Date] < SelectedDate
&& 'Staffing'[End Date] > SelectedDate
)
)

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @metcala 

please try

=
VAR SelectedDate =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
COUNTA ( 'Staffing'[EmployeeID/VacancyID] ),
FILTER (
'Staffing',
LEFT ( 'Staffing'[EmployeeID/VacancyID], 1 ) <> "1"
&& 'Staffing'[Start Date] < SelectedDate
&& 'Staffing'[End Date] > SelectedDate
)
)

tamerj1
Super User
Super User

@metcala 

Make sure there is no relationship between the two tables

@tamerj1 Thanks for the quick reply. I have just deleted all of the relationships between the Staffing table and Date table and I am still getting "Can not find name [Date]" in the below measure.

 

=CALCULATE(
   COUNTA('Staffing'[EmployeeID/VacancyID]),
   FILTER('Staffing',LEFT('Staffing'[EmployeeID/VacancyID],1)<>"1",
   FILTER('Staffing','Staffing'[Start Date]<'Date'[Date] && 'Staffing'[End Date]>'Date'[Date])
)

 

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.