I am trying to recreate numbers which I easily calculated in excel and now I would like to have calculated in Power BI. To be more precise I would like to have it in power query/M and NOT in DAX due to later calculations. To be more specific I would like to calculate the coefficients a and b of an exponential equation exponential y=ae^(bx).
In the following picture, you can see the data and also a graph over the data. Furthermore, the graph also displays a trendline using an exponential function and above the equation is shown y=6,5408e^(0,2834x). These coefficients are calculated in cell b14 and b15 and the calculations are shown in d14 and d15 (my excel is set to Danish, the English version of a is calculated using ex(index(linest(ln( and b by index(linest(ln( ).
As you can see, to calculate the coefficients, a column with index have been created in column c. To calculate the coefficients I used the LN() function on a list/array in excel, and the only power query/M function I can find is Number.Ln(), however, it does note take a list as input.
Due to the lack of on LN function in power query/M, I have a hard time calculating this, and I really hope someone has an answer to this!
Thank you in advance !
Kind Regards, Louise