Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am trying to calculate tenure and I believe my Dax is right because when I use my slicers to pick out an individual, for example myself, the calculation is correct. Yet when it is aggregated and takes into account the enitre employee populatiuon, it is off by like .5
Here is my dax
Does anyone have any insight? Happy to share more
Solved! Go to Solution.
Hi @GMireles ,
Since you divided by 365.25 in the manual calculation to account for leap years, you can modify the DAX formula to first calculate the number of days and then convert it to years by dividing by 365.25. This may help reduce the differences.
Average Tenure (Years) =
AVERAGEX(
'1',
DATEDIFF('1'[Hire Date], TODAY(), DAY) / 365.25
)
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @GMireles ,
Since you divided by 365.25 in the manual calculation to account for leap years, you can modify the DAX formula to first calculate the number of days and then convert it to years by dividing by 365.25. This may help reduce the differences.
Average Tenure (Years) =
AVERAGEX(
'1',
DATEDIFF('1'[Hire Date], TODAY(), DAY) / 365.25
)
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I was definitely overthinking it!! Thank you😀
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
10 |