Forum Discussion
RV1
7 years agoHelper I
Dynamic tenure calculator
Hi,
I am trying to display a list of staff that have completed x years on a specific date. Normally we calculate tenure as the difference between date_hired and today(). But the requirement is to calculate tenure based on selected dates.
I provided a date slicer and captured the selected date as follows:
Measure Selected Value = SELECTEDVALUE('Date'[Date])
Column Dynamic Tenure = IF(ISBLANK([Selected Value]), DATEDIFF(CurrentStaff[Date Hired], TODAY(), YEAR), DATEDIFF(CurrentStaff[Date Hired], [Selected Value], YEAR))
All records are showing the tenure as at today(). I believe the issue is with the use of measure Selected Value as it defaults to blank(). Even when we select different dates on the date slicer, the table does not refresh itself.
Help appreciated. Thanks
1 Reply
- v-danhe-msftMicrosoft Employee
Hi RV1 ,
Could you please post some simple sample data and your desired result to have a test if possible? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Regards,
Daniel He