Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I need to calculate AvgPatients for coming 6 months using below linear and logorothemic trend formulas
My Data like this..
Hi @Anonymous ,
I'm not clear about the following formulas, could you please explain it with some examples? M,X,A,B and C in the formula means fields or something else? How are the data of the current date and the data of the future date calculated? And if it involve any calculation, please provide the related calculation logic. As checked the visual screenshot, there are 4 lines on it. What does each line represent?
- A -Linear trend formula: Y= M*X + C
- B -Logarithmic trend formula: Y= B1*ln(X) + B0
- Avg patients for coming 6 months = 70*A+ 30*B
Best Regards
Rena
Due to forecast single line issue, I am manually calculating liner trend.
I calculated liner trend using below formula in a mesure but how to calculate for coming 6 months and how to display forecast data in different color
Hi @Anonymous ,
You can refer the following threads to achieve it.
Forecasting Logic in Power BI with DAX
How to calculate future months
Best Regards
Rena
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) ?
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
60 | |
57 |