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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.