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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
N5
Regular Visitor

Tenure Calculation in PowerBI - Incorrect Year calculation

Hi All,
I used the below DAX formula for the tenure calculation in PowerBI. But it gives wrong calculation for the Year.

For example someone who joined in 25 March 2019. Ideally it should be 3 Years and 10 Months. DAX formula gives 04 Years and 10 Months. Can someone help me correcting this formula?

Tenure =

VAR EndingDate =
 TODAY()
 
VAR Yr = DATEDIFF('Active Headcount'[Continuous Service Sysco LABS (Internship/Contract/Permanent)], EndingDate, YEAR)
VAR Mo = MOD(DATEDIFF('Active Headcount'[Continuous Service Sysco LABS (Internship/Contract/Permanent)], EndingDate, MONTH),12)

VAR Tenure =
 IF(
 Yr > 0,
 COMBINEVALUES(" ", Yr,"Years", Mo,"Months"),
 COMBINEVALUES(" ", Mo,"Months")
 )
 
RETURN Tenure
1 REPLY 1
johnt75
Super User
Super User

Try

Tenure =
VAR EndingDate =
    TODAY ()
VAR Mo =
    MOD (
        DATEDIFF (
            'Active Headcount'[Continuous Service Sysco LABS (Internship/Contract/Permanent)],
            EndingDate,
            MONTH
        ),
        12
    )
VAR Yr =
    QUOTIENT (
        DATEDIFF (
            'Active Headcount'[Continuous Service Sysco LABS (Internship/Contract/Permanent)],
            EndingDate,
            MONTH
        ),
        12
    )
VAR Tenure =
    IF (
        Yr > 0,
        COMBINEVALUES ( " ", Yr, "Years", Mo, "Months" ),
        COMBINEVALUES ( " ", Mo, "Months" )
    )
RETURN
    Tenure

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.