cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Calculating KPI for a date range.

Hello,

Can you guys please help me in deducing a solution for this ?-

 

KPI: Attrition in % and Number for the selected period. (Refer to 'Calculations' Part for explaination)

Calculation-

subho220_0-1599137553947.png

 

Data ->

subho220_1-1599137663814.png

 

I just need an approach to do it. Many thanks

1 ACCEPTED SOLUTION
Super User IV
Super User IV

@subho220 - If I understand correctly:

 

Measure Total Leavers =
  VAR __Start = <start date>
  VAR __End = <end date>
RETURN
  COUNTROWS(FILTER('Table',[TerminationDate] >= __Start && [TerminationDate]<=__End))

I have a bunch of recipes for this sort of thing in DAX Cookbook in Chapter 7: https://github.com/gdeckler/DAXCookbook

 


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Super User IV
Super User IV

@subho220 , refer my HR blog, see if this can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Thanks a lot. It is really helpful.

Super User IV
Super User IV

@subho220 - If I understand correctly:

 

Measure Total Leavers =
  VAR __Start = <start date>
  VAR __End = <end date>
RETURN
  COUNTROWS(FILTER('Table',[TerminationDate] >= __Start && [TerminationDate]<=__End))

I have a bunch of recipes for this sort of thing in DAX Cookbook in Chapter 7: https://github.com/gdeckler/DAXCookbook

 


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors