Forum Discussion

deSanta's avatar
deSanta
Regular Visitor
3 years ago

creating line charts with trendlines

I want to create a line chart based on a data similar to the one below. need to have 'CLASS' in the x axis, and 'SCORE' in the y-axis. Then I need to add a trendline, and have a slicer for 'ID' .  Finnaly I need to have a card that shows the slope of the trendline. 

IDCLASSSCORE

1

a-2
2a1
3a6
1b4
2b3
3b-5
1c-2
2c4
3c6
1d-1
2d3
3d7

 

I am new at power BI, so I am not well versed in writting DAX. I noticed that power BI only shows the trendline option in the Analytics tab when both x and y axis are numerical. Also, I could not find an option to display the slope of the trendline even if I convert my categorical column into numerical. I tried to follow a previously posted example  to manually create the  trendlines, but the slope of the trendline I obtained never changes when a new ID is selected in the slicer.

 

I would sincerelly appreciate the help.  

1 Reply