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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Gulian
New Member

Line graph of student grade over the last year

Help me please:

 

Name19-20 maths19-20 french20-21 math20-21 french21-22 math21-22 french
John857668845445
Bob758774807685
Roger559268907588

 

This is the data I have right now. 

 

I want to be able to show in a line graph the year progression of a selected subject for a specific student selected with a filter. 

 

Exemple of the X axis wanted : 19-20 math, 20-21 math, 21-22 math. 

Example of Y axis wanted : result 1 to 100.  

 

 

I am a pBI beginner.

 

Thanks. 

1 ACCEPTED SOLUTION
Syk
Super User
Super User

You will want to change your table structure a bit! In the Power Query Editor click the transform tab and select your Name column. Next, select the unpivot columns dropdown > click 'Unpivot other columns'

Syk_0-1676992423239.png

 

Next, we can split out the year and the subject from 1 field into 2. This will help with filtering and such later (or if you wanted to see an average for the year for a student without a specific subject).

Under the transform tab, select your 'Attribute' column (this should be your year/subject). Click the split column > by number of characters and set your parameters as shown in this screenshot.

Syk_1-1676992683838.png

You can rename your columns to reflect what they mean. You should be left with something like this:
*side note, this data has multiple math variations.. You can find/replace with whichever math(s) you want to use in the subject column. Right click column > Replace values

Syk_2-1676992811334.png

 

Click the home tab > close and apply.

To create your line graph as detailed in your post. Click the line chart, add in your year and subject to the x-axis. Grade in the y-axis, and create filters for your students and subjects. You should be left with something like this:

Syk_3-1676993362937.png

 

If you want to edit your axis range, click the format visual button (in the visualizations pane) > expand y-axis > set your min and max to 1 and 100. You'll have your final graph!

 

Syk_4-1676993463504.png

 

Mark this post as a solution if it helps and reply to this if you have further questions!

 

 

View solution in original post

2 REPLIES 2
Syk
Super User
Super User

You will want to change your table structure a bit! In the Power Query Editor click the transform tab and select your Name column. Next, select the unpivot columns dropdown > click 'Unpivot other columns'

Syk_0-1676992423239.png

 

Next, we can split out the year and the subject from 1 field into 2. This will help with filtering and such later (or if you wanted to see an average for the year for a student without a specific subject).

Under the transform tab, select your 'Attribute' column (this should be your year/subject). Click the split column > by number of characters and set your parameters as shown in this screenshot.

Syk_1-1676992683838.png

You can rename your columns to reflect what they mean. You should be left with something like this:
*side note, this data has multiple math variations.. You can find/replace with whichever math(s) you want to use in the subject column. Right click column > Replace values

Syk_2-1676992811334.png

 

Click the home tab > close and apply.

To create your line graph as detailed in your post. Click the line chart, add in your year and subject to the x-axis. Grade in the y-axis, and create filters for your students and subjects. You should be left with something like this:

Syk_3-1676993362937.png

 

If you want to edit your axis range, click the format visual button (in the visualizations pane) > expand y-axis > set your min and max to 1 and 100. You'll have your final graph!

 

Syk_4-1676993463504.png

 

Mark this post as a solution if it helps and reply to this if you have further questions!

 

 

Thanks, it works perfectly, very easy to understand.

 

So simple yet I was so far of achieving it. 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.