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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RV1
Helper I
Helper 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 1
v-danhe-msft
Employee
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

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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