Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello all,
I have a Access db backend for an HR db that for the purposes of this conversation has two dates: approved date and filled date. All positions will have an approved date, but not all have a filled date (since not all positions are filled). I want to have a time to hire measure that shows average time to hire by month. Average time to hire only applies if a position has been filled, so the measure should only look at positions that are filled and subtracting from that the approved date to give me average days it took.
Solved! Go to Solution.
Hi @Decal ,
Based on the testing, create the sample table.
Then, using the following DAX formula.
Avg Time =
CALCULATE(
AVERAGEX(
'PowerBIPosition',
DATEDIFF(
'PowerBIPosition'[Approved Date],
'PowerBIPosition'[Fill Date],
DAY
)
),
FILTER(PowerBIPosition,
PowerBIPosition[Fill Date] >= FIRSTDATE(DimDate[Date]) && PowerBIPosition[Fill Date] <= LASTDATE(DimDate[Date]) && NOT(ISBLANK('PowerBIPosition'[Fill Date])) && 'PowerBIPosition'[Fill Status] = "Filled")
)
Select 2024 year to filter the page. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Decal ,
Based on the testing, create the sample table.
Then, using the following DAX formula.
Avg Time =
CALCULATE(
AVERAGEX(
'PowerBIPosition',
DATEDIFF(
'PowerBIPosition'[Approved Date],
'PowerBIPosition'[Fill Date],
DAY
)
),
FILTER(PowerBIPosition,
PowerBIPosition[Fill Date] >= FIRSTDATE(DimDate[Date]) && PowerBIPosition[Fill Date] <= LASTDATE(DimDate[Date]) && NOT(ISBLANK('PowerBIPosition'[Fill Date])) && 'PowerBIPosition'[Fill Status] = "Filled")
)
Select 2024 year to filter the page. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share the download link of the PBI file. Show the problem there very clearly and also the expected result.
Since it's an HR file, I can't provide the whole file, but it can be looked at this way.
Position | Approved Date | Fill Date | Average Time to Hire | Time to Hire Base |
16 | 11/17/2023 | 6/7/2024 | 203.00 | 203.0 |
22 | 1/1/2024 | 1/5/2025 | 307.0 |
Even if I'm bypassing all of the date tables, why isn't the Avg Time to Hire calculating?
Is that really how your raw data is? You can post a sample data with confidential information removed. That's how most users in the forum do it.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
26 |
User | Count |
---|---|
91 | |
49 | |
44 | |
38 | |
37 |