Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

LINEST Dax equivalent

Hi all,

 

I originally created my power bi model by simply importing data from an excel model, but now my task is to do all the calculations in power bi itself to make the excel model redundent.

With power bi not having all the functions that excel has, I'm having trouble calculating an estimated values table for 2 variables using linear regression dax code. I've tried using the following measure: https://community.powerbi.com/t5/Desktop/Liner-Regression-in-DAX-query-and-EXCEL-Linest/m-p/579390#M273985

However, I'm not quite sure how to apply it to my situation.

 

Here is the table im trying to produce: It actually has 38 columns (not including date) of the same calculations. The data used for the calulcations was pulled from a table of normalized values (15min. resolution) and the values were calculated using the formula: LINEST(Normalized!B$2:B$2977,IF(Normalized!B$2:B$2977>0,Normalized!$AN$2:$AN$2977,0),FALSE,TRUE)*1100

-the value range of the formula is dictated by month

DateInverter 01.1
1/01/20200.905523712
1/02/20200.935388997
1/03/20200.985759406
1/04/20200.977461843
1/05/20200.974799106
1/06/20200.979397699
1/07/20200.984387728
1/08/20200.955793923

I already have the normalized values table in power bi, now I just need to produce a table of values using linear regression in the format of the table above. I understand this is a big ask but any and all help would be appretiated.

 

Many thanks.

2 Replies