Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi I am trying to calulate retention rate year by year.
My current measure is:
Solved! Go to Solution.
@benz-fsproduce , I want you remove the if condition, as max of 2022 is > today
Retention Rate 2 =
VAR _StartOfPeriod = MIN('Date'[Date])
VAR _EndOfPeriod = MAX('Date'[Date])
VAR _Result =
IF( 1=1,
VAR _EmployeesAtStart =
CALCULATETABLE(
VALUES(page[Employee Name]),
page[Last Hire Date] <= _StartOfPeriod,
page[Termination Date] >= _StartOfPeriod || ISBLANK(page[Termination Date])
)
VAR _EmployeesAtEnd =
CALCULATETABLE(
VALUES(page[Employee Name]),
page[Last Hire Date] <= _EndOfPeriod,
page[Termination Date] >= _EndOfPeriod || ISBLANK(page[Termination Date])
)
VAR _NoOFEmployeesAtStartAndEnd =
COUNTROWS(
INTERSECT(_EmployeesAtStart, _EmployeesAtEnd)
)
RETURN
DIVIDE(_NoOFEmployeesAtStartAndEnd, COUNTROWS(_EmployeesAtStart))
)
RETURN
_Result
@benz-fsproduce , remove the condition on today and try.
if not share formula in text format
@benz-fsproduce , I want you remove the if condition, as max of 2022 is > today
Retention Rate 2 =
VAR _StartOfPeriod = MIN('Date'[Date])
VAR _EndOfPeriod = MAX('Date'[Date])
VAR _Result =
IF( 1=1,
VAR _EmployeesAtStart =
CALCULATETABLE(
VALUES(page[Employee Name]),
page[Last Hire Date] <= _StartOfPeriod,
page[Termination Date] >= _StartOfPeriod || ISBLANK(page[Termination Date])
)
VAR _EmployeesAtEnd =
CALCULATETABLE(
VALUES(page[Employee Name]),
page[Last Hire Date] <= _EndOfPeriod,
page[Termination Date] >= _EndOfPeriod || ISBLANK(page[Termination Date])
)
VAR _NoOFEmployeesAtStartAndEnd =
COUNTROWS(
INTERSECT(_EmployeesAtStart, _EmployeesAtEnd)
)
RETURN
DIVIDE(_NoOFEmployeesAtStartAndEnd, COUNTROWS(_EmployeesAtStart))
)
RETURN
_Result
User | Count |
---|---|
117 | |
75 | |
62 | |
50 | |
44 |
User | Count |
---|---|
174 | |
125 | |
60 | |
60 | |
57 |