Forum Discussion
PowerBIUserX
2 years agoFrequent Visitor
Trend analysis using linear regression gradient per category
Hi, I'm building a report and need to calculate a trend over time per category, to identify top increases/decreases over time. The end goal is to have a trend value (gradient of linear regressio...
- Anonymous2 years ago
Hi PowerBIUserX
I add a month column in the table
Then modifiy the Lines measure
Lines = VAR a = LINESTX ( FILTER ( ALLSELECTED ( 'Table' ), [Category] IN VALUES ( 'Table'[Category] ) ), [Value_measure], [Month] ) RETURN MINX ( a, [Slope1] )Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Anonymous
2 years agoNot applicable
Hi PowerBIUserX
I add a month column in the table
Then modifiy the Lines measure
Lines =
VAR a =
LINESTX (
FILTER ( ALLSELECTED ( 'Table' ), [Category] IN VALUES ( 'Table'[Category] ) ),
[Value_measure],
[Month]
)
RETURN
MINX ( a, [Slope1] )
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
PowerBIUserX
2 years agoFrequent Visitor
Works perfectly! Thank you so much 😊