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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
silasmiddleton
Regular Visitor

Line Graph Over Time: When the Column Header Contains the Year, and the cells contain values.

If this is posted somewhere else, please direct me.
Perhaps I dont know the terminology to pinpoint what I am chasing. 

I am trying to map out a student markbook to show their growth over time. 

Student NameSemester 1, 2020Semester 2, 2020Semester 1, 2021Semester 2, 20212022; Semester 2
Brad Pitt3.52.842.74
George Clooney2.82.133.13.8
Krusty the Clown2.61.022.11.9

*Names and grade are fictitious.

I would like a graph that maps out their progress over time in a line graph. 
I can do when the Dates are in a column, but not as a Row. 
Much appreciated. 



1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@silasmiddleton , Unpivot this data. You should get semester as one column

Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g

 

Create a new table for the semester, example in Dax

semester = distinct(Table[semester])

 

Create rank on semester as a new column in the semester table

semester rank = rankx( semester , semester [semester],,asc,dense)

 

then create measure like

 

This semester= CALCULATE(sum('Table'[Score]), FILTER(ALL('semester'),'Date'[semester Rank]=max('Date'[semester Rank])))
Last semester= CALCULATE(sum('Table'[Score]), FILTER(ALL('semester'),'Date'[semester Rank]=max('Date'[semester  Rank])-1))

 

 

Same logic as week or custom period

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

 

Join with semester of table

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@silasmiddleton , Unpivot this data. You should get semester as one column

Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g

 

Create a new table for the semester, example in Dax

semester = distinct(Table[semester])

 

Create rank on semester as a new column in the semester table

semester rank = rankx( semester , semester [semester],,asc,dense)

 

then create measure like

 

This semester= CALCULATE(sum('Table'[Score]), FILTER(ALL('semester'),'Date'[semester Rank]=max('Date'[semester Rank])))
Last semester= CALCULATE(sum('Table'[Score]), FILTER(ALL('semester'),'Date'[semester Rank]=max('Date'[semester  Rank])-1))

 

 

Same logic as week or custom period

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

 

Join with semester of table

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors