Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Annualize Ratios Dynamic (Year Quarter Month on annual basis with drill down) using DAX in Power BI

$
0
0

A basic need for many clients is to compute an annualized attrition rate. The baseline formula  - assuming we're talking client attrition - would be:

 

Annualized attrition rate % =  (count of lost clients in period * 100 * (days in year / days in period)) / (number of clients a period start)

 

The (100* (days in year / days in period)) component is called a Period Annualization Factor or PAF

 

This is a no brainer if you just want a monthly rate. In fact using "12" as a proxy for (days in year / days) in period is a decent proxy i.e. it computes out pretty closely - within 2%. But that is not accurate enough for our client.

 

daysinmonths.PNG

 Even more importantly this math does not enable proper drill down (or up) on the Rate by Year, Quarter, or Week for example. To do that we need to have dynamic count of days in the period selected (in our case using a date slicer). So when we build a report that is based on a time series, and we want to have different levels of categoric date summary for a calculated rate, we are finding no joy.

 

Already attempted:

Use FIRSTDATE and LASTDATE with YEARFRAC as:

  •  DateRangeFirst = FIRSTDATE(Datatable[EffectiveDate].[Date])
  •  DateRangeLast = LASTDATE(Datatable[EffectiveDate].[Date])
  • DatePAF = 100/(YEARFRAC([DateRangeFirst],[DateRangeLast],3))

 

Anyone know how to make the count of number of days in a selected date range dynamic?

 

 

I expect someone has figured this out already, but I have googled, searched the forums and spent more than a day researching this in DAX examples with no joy. Hopefully when we figure it out (with your kind help?!?!?) it will benefit many others.

 

Thanks in advance for your thoughts, ideas and advice !

 

- Dave

 

 

 

Also, and more importantly

 


Viewing all articles
Browse latest Browse all 213819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>