cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
freshwave Frequent Visitor
Frequent Visitor

Grade History Table

I have a table that stores grades per students periodically on the first of the month.  I would like to be able to graph what the most recent grade letter is per student even if there wasn't a grade given that month.  The Grades range from A-F, and the grades are only tabulated on the first of the month.

 

I have a Students and Grades tables as you can see below

image.pngStudents Table

 

 

 

 

 

 

 

 

image.pngGrades Table

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I was hoping to create a table with the desired result below unless there is a simplistic way to create measures that would allow for me to display the same results.  If you want to play with it directly, you can download my PBIX file at https://drive.google.com/open?id=1xSUeCcKmA_7uL5sbbTarupaM84NiJKrW.

 

My current measure formula is below though seems to calculate for the month of the grade, and then skip until the next grade change for the student.

 

Grade History =
SELECTCOLUMNS (
GENERATE (
'GRADES',
FILTER (
ALLNOBLANKROW ( Dates ),
// Shows one grade date mapped to date
MAXX (
FILTER ( 'GRADES', 'GRADES'[GradeDate] <= Dates[Date] ),
'GRADES'[GradeDate]
)
= 'GRADES'[GradeDate]
&& RELATED ( 'STUDENTS'[StartDate] ) <= Dates[Date]
&& IF (
ISBLANK ( RELATED ( 'STUDENTS'[EndDate] ) ),
Dates[Date],
RELATED ( 'STUDENTS'[EndDate] )
)
>= Dates[Date]
&& ISBLANK ( RELATED ( 'STUDENTS'[STUDENTID] ) ) = FALSE ()
&& Dates[Date] >= DATE ( 2017, 01, 01 )
)
),
"Date", Dates[Date],
"StudentID", Grades[StudentID],
"GradeDate", 'GRADES'[GradeDate],
"Grade", 'GRADES'[Grade]
)

 

Thanks

 

image.pngDesired Result - Grades History Table

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Grade History Table

@freshwave,

 

Here is an example for your reference.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Grade History Table

@freshwave,

 

Here is an example for your reference.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

freshwave Frequent Visitor
Frequent Visitor

Re: Grade History Table

Thanks for the quick response.  I am still a newbie when it comes to DAX.

 

I admit I am a bit lost comparing that example where he has two transactions and wants to get the exchange rate to my wanting to build a table that gives me the GradeDate and Grade for the first of every month.

 

Please explain further.

EDITED 03/23/18 12:10PM
It must have taken me some time to digest it as it seemed to make sense last night, and I was able to get it to work today.

 

Thank you very much for your help.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 56 members 751 guests
Please welcome our newest community members: