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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.