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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.