Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
deSanta
Regular Visitor

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 1
amitchandak
Super User
Super User

@deSanta , That option is only available with Date/Numbers on the x-axis

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors