0

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( ).

enter image description here

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

Ron Rosenfeld
  • 53,870
  • 7
  • 28
  • 60

1 Answers1

0

Number.Ln()

Returns the natural logarithm of a number, number. If number is null Number.Ln returns null.

https://learn.microsoft.com/en-us/powerquery-m/number-ln

Also check out

https://www.bookkempt.com/2017/10/simple-linear-regression-in-power-query.html

horseyride
  • 17,007
  • 2
  • 11
  • 22