Forum Discussion

Chitemerere's avatar
Chitemerere
Icon for Responsive Resident rankResponsive Resident
6 years ago

Calculating Moving Annual Totals, Growth Rates and Evolution Index

I am new to Power BI and in the past i have used another BI tool.  I previously created the following report in this tool:

 

MAT is moving annual total, EI is Evolution Index which is simply the growth rate of a particular drug name compared to the overall total growth rate in the table and CAGR is the compounded annual growth rate calcuated over all the years in the data set.  The CAGR uses all years for calcuation not just the first and last years.  The table above has two MAT, the current month MAT versus last year same period MAT.  These figures are calculated dynamically at the end of the month when the data is refreshed with new data.  No filters are applied as they are not necessary in this context.

 

I have tried replicating the above report in Power BI using various recommendations in previous posts with no success as the use case above is different from what is currently available.  In my previous tool, the expression to calculate the MAT for the current year is as follows:

Num(sum({<[Date Dispensed]={">=$(=addmonths(MonthEnd(max([Date Dispensed]))+1,-12)) <=$(=max([Date Dispensed]))"}>}[Amount Dispensed]), '$##,##0.00') 

 

I would simply replace the value 12 highlighted in green with 24 to get the MAT for last year, 36 for last year but one etc.

 

The headers are also dynamically populated when the new data is fetched at the end of the month.

 

Is there anyone out there who can assist especially with the calculation of the MAT?

 

Thanking you in advance.

 

Best regards,

Chris

2 Replies