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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ABR002
Helper I
Helper I

Status Change Rate Calculation grouping using previous dates

I'm trying to get a rate of people who have had a status change from Active to Inactive in a dataset from week to week. Example:

NameStatusPeriod End DateWeek Rank
DaveActive6/30/20221
ShellyInactive6/30/20221
RoyInactive6/30/20221
TomActive6/30/20221
MonicaActive6/30/20221
DaveInactive6/23/20222
ShellyInactive6/23/20222
RoyInactive6/23/20222
TomInactive6/23/20222
MonicaActive6/23/20222
DaveActive6/16/20223
ShellyInactive6/16/20223
RoyInactive6/16/20223
TomActive6/16/20223
MonicaActive6/16/20223


Basically Where employee Status = "active" AND week rank = Minimum / Status = "inactive" where week rank = 1 above the minimum
It's essentially the 1 above the minimum that's killing me. Can do the other parts .
Any advice would be appreciated. 

1 ACCEPTED SOLUTION
nirali_arora
Resolver II
Resolver II

  1. Create two calculated tables to filter "Active" and "Inactive" employees for each week rank.

    ActiveEmployees = FILTER(EmployeeStatus, EmployeeStatus[Status] = "Active") InactiveEmployees = FILTER(EmployeeStatus, EmployeeStatus[Status] = "Inactive")
  2. Create a calculated column that calculates the minimum WeekRank for each employee.

    MinWeekRank = CALCULATE(MIN(EmployeeStatus[WeekRank]), ALLEXCEPT(EmployeeStatus, EmployeeStatus[EmployeeID]))
  3. Create a calculated column to identify employees who transitioned from "Active" to "Inactive" and have WeekRank 1 above the minimum.

    TransitionedToInactive = IF ( EmployeeStatus[Status] = "Active" && EmployeeStatus[WeekRank] = [MinWeekRank] + 1 && COUNTROWS( FILTER( InactiveEmployees, InactiveEmployees[EmployeeID] = EmployeeStatus[EmployeeID] ) ) > 0, 1, 0 )
  4. Create a measure to calculate the rate of transitions:

    TransitionRate = DIVIDE( SUM(EmployeeStatus[TransitionedToInactive]), COUNTROWS(EmployeeStatus) )

This measure, "TransitionRate," will give you the rate of employees who transitioned from "Active" to "Inactive" with WeekRank 1 above the minimum WeekRank.

View solution in original post

1 REPLY 1
nirali_arora
Resolver II
Resolver II

  1. Create two calculated tables to filter "Active" and "Inactive" employees for each week rank.

    ActiveEmployees = FILTER(EmployeeStatus, EmployeeStatus[Status] = "Active") InactiveEmployees = FILTER(EmployeeStatus, EmployeeStatus[Status] = "Inactive")
  2. Create a calculated column that calculates the minimum WeekRank for each employee.

    MinWeekRank = CALCULATE(MIN(EmployeeStatus[WeekRank]), ALLEXCEPT(EmployeeStatus, EmployeeStatus[EmployeeID]))
  3. Create a calculated column to identify employees who transitioned from "Active" to "Inactive" and have WeekRank 1 above the minimum.

    TransitionedToInactive = IF ( EmployeeStatus[Status] = "Active" && EmployeeStatus[WeekRank] = [MinWeekRank] + 1 && COUNTROWS( FILTER( InactiveEmployees, InactiveEmployees[EmployeeID] = EmployeeStatus[EmployeeID] ) ) > 0, 1, 0 )
  4. Create a measure to calculate the rate of transitions:

    TransitionRate = DIVIDE( SUM(EmployeeStatus[TransitionedToInactive]), COUNTROWS(EmployeeStatus) )

This measure, "TransitionRate," will give you the rate of employees who transitioned from "Active" to "Inactive" with WeekRank 1 above the minimum WeekRank.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.