Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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
Solved! Go to Solution.
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
)
)
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 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])
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |