Forum Discussion
Regression Formula
The dificulty is that the columns I am using are from 2 diffrent tables. I have tried to use power query to merge the tables but becuase they are so large, power query consitently crashes. (3 m rows). So Im trying to write a regression formula using "LN(x)" which is a calculated column and "cost % column" which is another calculated column.
Power Query can be written in an optimized manner as well, just like DAX. Not all DAX is performant as well as not all M is. One has to investigate how to write it to make it fast. 3M rows does not seem to be an overly excessive figure for M not to be able to handle this gracefully and quickly. I think your code is just.... suboptimal. Please, for any M optimizations consult the blog of Chris Webb, Chris Webb's BI Blog: Power Query Chris Webb's BI Blog (crossjoin.co.uk). Or, alternatively, you could ask a question about it on the PBI forum dedicated to Power Query/M.