Forum Discussion
alearner
1 year agoHelper I
Growth rate calculation
Hello, I am trying to compare the Growth Rate for a Set of Mutula Fund Schemes. I have a table which has the NAV for the last couple of years and the table name is NAV. As a first step what I hav...
- 1 year ago
Dangar332 I achieved what I wanted to implement however I had to take the help of Python to achieve it. I used Pyth to achieve what I was implementing via the below code.
GrowthRate =var minDate = MIN('Date'[Date])var maxDate = MAX('Date'[Date])var nonnullDate = CALCULATE(MAX('Date'[Date]),FILTER(ALL(NAV),NAV[navDate] <= MAX('Date'[Date]) &&(NAV[navValue]) <> 0))VAR nonblanknav = CALCULATE(sum(NAV[navValue]),'Date'[Date] = nonnullDate)return nonblanknav.I imported the data in PowerBI and then using the below code I achieved the final result:GrowthRate =var strtdt = CALCULATE(MIN('Date'[Date]), ALLSELECTED('Date'))var enddt = MAX('Date'[Date])var mindateNAV = CALCULATE(SUM(ALL_NAV[navValue]),'Date'[Date]= strtdt)VAR change = SUM(ALL_NAV[navValue])-mindateNAVRETURN DIVIDE(change,mindateNAV)The Graph: As you can see I can do a comparison on what the returns have been over the specified time duration selected in slicer.