cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Anonymous
Not applicable

## How to calculate logarithemic regression : Y = a + b * ln (X) manually using DAX?

Calculated Liner regression Y= mx+c using below calculation

``````LinearTrend-A-MB =
VAR Known =
FILTER (
SELECTCOLUMNS (
CALCULATETABLE ( VALUES ( ConsumptionDate[DateNumber] ), ALLSELECTED (ConsumptionDate) ),
"Known[X]", 'ConsumptionDate'[DateNumber],
"Known[Y]", PatientsNormalized[A-MB]
),
AND ( NOT ( ISBLANK ( Known[X] ) ), NOT ( ISBLANK ( Known[Y] ) ) )
)
VAR Count_Items =
COUNTROWS ( Known )
VAR Sum_X =
SUMX ( Known, Known[X] )
VAR Sum_X2 =
SUMX ( Known, Known[X] ^ 2 )
VAR Sum_Y =
SUMX ( Known, Known[Y] )
VAR Sum_XY =
SUMX ( Known, Known[X] * Known[Y] )
VAR Average_X =
AVERAGEX ( Known, Known[X] )
VAR Average_Y =
AVERAGEX ( Known, Known[Y] )
VAR Slope =
DIVIDE (
Count_Items * Sum_XY - Sum_X * Sum_Y,
Count_Items * Sum_X2 - Sum_X ^ 2
)
VAR Intercept = Average_Y
- Slope * Average_X
RETURN
SUMX( DISTINCT ( ConsumptionDate[DateNumber] ),
Intercept + Slope * ConsumptionDate[DateNumber]
)``````

Please help me how to calculate logarithemic regression : Y = a + b * ln (X) ?

Community Champion

@Anonymous  Have you tried looking at below link for help

https://towardsdatascience.com/building-and-optimizing-multiple-linear-regression-in-powerbi-using-dax-ed468e1ec2ae

https://www.bluegranite.com/blog/simple-linear-regression-in-power-bi

https://stackoverflow.com/questions/48796873/multiple-linear-regression-in-power-bi

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!