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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
ejafarov
Helper I
Helper I

Calculating employee tenure 12 months before

Dears, 

How can I find employee tenure 12 months before from selected date?

The below formula does not work correctly.

 

Tenure for 12 months before =
VAR SelectedDate = MAX(Teqvim[Date])
VAR RelevantPeriodStart = EDATE(SelectedDate, -12)
VAR T1 = CALCULATETABLE(Final, CROSSFILTER(Teqvim[Date], Final[Start Date], NONE))
VAR T2 = FILTER(T1, Final[Start Date] <= SelectedDate && Final[Start Date] >= RelevantPeriodStart)
RETURN
AVERAGEX(
T2,
VAR StartDate = Final[Start Date]
VAR EndDate = COALESCE(Final[Resignation Date], TODAY())
RETURN DATEDIFF(StartDate, MIN(EndDate, SelectedDate), MONTH)
)

Thanks in advance

1 REPLY 1
MohammadLoran25
Solution Sage
Solution Sage

Hi @ejafarov ,

Based on the previous topic we had, If you mean the TenureMeasure for the Same Month of previous year, you can create this measure:

 

CALCULATE (
    [TenureInThePreviousTopic],
    FILTER (
        ALL ( DateTable ),
        DateTable[YearMonthIndex] = MAX ( DateTable[YearMonthIndex] )-12
    )
)

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.