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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculate Attrition Delta for a Report

Hi All

 

Can you please help me to derive the Attrition Delta formula/Measure in Power BI:

 

I am working on a employee Attrition report , where my measures are Total active employees,Attriton,  and other measures etc like "Attrition rate" Measure (derived formula not direct column) etc calculated at the month level  and Service line Level in the view.

 

Month Level Attrition Rate Value.

Month/YearAttrition Rate
Jan-226.34%
Feb-225.30%
Mar-225.89%
Apr-225.73%
May-225.41%
Jun-223.38%

 

Attrition rate at the service Line Level when A user selects (ex-Data Analyst) as a service from the dropdown slicer

Month/YearAttrition Rate(Service Line level)
Jan-225.06%
Feb-224.85%
Mar-225.66%
Apr-225.74%
May-223.93%
Jun-223.83%

 

I am expecting an output with

Attrition Delta
1.28%
0.44%
0.23%
-0.01%
1.48%
-0.44%

 

I am attaching the screenshot of sample data

naveen121_0-1660134850874.png

 

When a user select a service line (ex-Data Analyst)  from the Service line slicer he should get the Attrition Delta as below:

(Attrition Delta) = (Total attrition rate at the Jan month level)- (attrition rate for  the selected Service line level for the Jan month)

    i.e  (Attrition Delta)= 6.34 -5.06 = 1.28% for January and so on for other months..

 

As I am new bee, I am not sure how to achieve this logic . I was thinking if we can create 2 variable to store month level attrition rate and other variable to store Serive level ..

 

 

Please help on this! 

 

Thanks,

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Please try

Attrition Delta =
CALCULATE ( [Attrition], ALL ( TableName[Service] ) ) - [Attrition]

View solution in original post

6 REPLIES 6
tamerj1
Super User
Super User

Hi @Anonymous 
Please try

Attrition Delta =
CALCULATE ( [Attrition], ALL ( TableName[Service] ) ) - [Attrition]
Anonymous
Not applicable

@tamerj1 : Thanks for the reply.

Unfortunately, I cannot use your Measure 

Attrition Delta =
CALCULATE ( [Attrition], ALL ( TableName[Service] ) ) - [Attrition]

I can include  [Service] in your formula as the attrition rate at service level is already available in my view, but i dont have [Attrition] which is Total attriton rate for month level . 

My challenge now is how to derive  this month level attrition rate so that I  fill in your measure.

You might ask me how did I get the the below  Attrition rate  % numbers for overall, I got them by dragging the month into the view without using the service line in the view.

 

Attrition rate % is a derived formula which is = (Employees left the company for a month) / (Average of employee closing and opening counts)

Month/YearAttrition Rate
Jan-226.34%
Feb-225.30%
Mar-225.89%
Apr-225.73%
May-225.41%
Jun-223.38%

@Anonymous 
Why you cannot use the measure? Did you even try? Here is the same formula with corrected measure name

Attrition Delta =
CALCULATE ( [Attrition rate %], ALL ( TableName[Service] ) ) - [Attrition rate %]
Anonymous
Not applicable

Hi @lbendlin , @tamerj1 , @SpartaBI , @ray_ux , @amitchandak  - Can you guys please help with this topic in creating a delta measure:

Calculate Attrition Delta for a Report

amitchandak
Super User
Super User

@Anonymous , Create common tables like date/month and service and try to use that

 

refer

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda

 

 

it can work even if service is available in one table

Anonymous
Not applicable

Hi Amit,

Unfortunately I cannot create a common table as of now due to restricted access and time frame. 

Can you please help me to give an alternative solution to create Delta logic with the scenario. Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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