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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
apaulso9
Resolver I
Resolver I

Turnover Rate -Non-rolling for current year.

Hello all,

 

Using DAX I calculated a rolling 12 month turnover rate. However, when I use a date slicer and select the current year it calculates back twelve months. Is there a way to calculate the turnover while seperating the years out? When I click on 2023 I would like it to calculate the turn over from January 1st to now. Below are my dax equations for my rolling turnover measure. Any help would be appreciated. Thank you very much.

 

Employee Turnover rate =

VAR averageEmployeesRolling12months = ([Employee Count]+[Employee Count 12 months before])/2

RETURN
[Employees who left past 12 months]/ averageEmployeesRolling12months
 
 
Employee Count =
VAR selectedDate = MAX('Date'[Date])

RETURN

SUMX('All Employees',
VAR employeeStartDate = [Date Started]
VAR employeeEndDate = [Date Terminated]
RETURN IF(employeeStartDate<= selectedDate && OR(employeeEndDate>=selectedDate, employeeEndDate=BLANK()),1,0)
)
 
Employee Count 12 months Before =
VAR selectedDate = NEXTDAY(SAMEPERIODLASTYEAR(LASTDATE('Date'[Date])))

RETURN
 SUMX('All Employees',
 VAR employeeStartDate = [Date Started]
 VAR employeeEndDate = [Date Terminated]
 RETURN IF(employeeStartDate<=selectedDate && OR(employeeEndDate>=selectedDate, employeeEndDate=BLANK() ),1,0)
 )  
 
1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @apaulso9,

If you want to use slicer to achieve selector effect instead of filter effects, I'd like to suggest you create an unconnected table a source of slicer and you can use Dax expression to extract the selection to compare and use in the current expression to filter with table records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @apaulso9,

If you want to use slicer to achieve selector effect instead of filter effects, I'd like to suggest you create an unconnected table a source of slicer and you can use Dax expression to extract the selection to compare and use in the current expression to filter with table records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help 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.