cmcreynolds
Active Member
- Joined
- May 21, 2015
- Messages
- 295
Hello - I'm looking at making various calculations in my Power Pivot Data Model based on college student information (total number of courses, total tuition, etc.) Students may take more than one course in a [startdate] (aka term).
I pull my data using Power Query and I have a custom field [OneYearOut - calculated in PQ] that just adds a year to the [startdate] field. I also have built a relationship from my data to a calendar table.
My task is to look at all information within a year from a student's FIRST [startdate]. I know there are calculations using DATESBETWEEN and EARLIEST and LATEST, but all the examples I have seen on mrescel.com confuse me as to when to use the date in my data vs the related date in the calendar table.
[TABLE="width: 500"]
<tbody>[TR]
[TD]StudentID[/TD]
[TD]StartDate[/TD]
[TD]OneYearOut[/TD]
[TD]CourseCode[/TD]
[TD]CreditHours[/TD]
[TD]Total Tuition[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]3/15/2013[/TD]
[TD]3/15/2014[/TD]
[TD]ENG100[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]3/15/2103[/TD]
[TD]3/15/2014[/TD]
[TD]MATH101[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]6/30/2013[/TD]
[TD]6/30/2014[/TD]
[TD]SOC200[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]6/30/2013[/TD]
[TD]6/30/2014[/TD]
[TD]HIS300[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]4/15/2014[/TD]
[TD]4/15/2015[/TD]
[TD]MATH103[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]B001[/TD]
[TD]5/15/2014[/TD]
[TD]5/15/2015[/TD]
[TD]ENG100[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]B001[/TD]
[TD]8/31/2014[/TD]
[TD]8/31/2015[/TD]
[TD]PE202[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]B001[/TD]
[TD]6/30/2015[/TD]
[TD]6/30/2016[/TD]
[TD]BUS105[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
</tbody>[/TABLE]
(PS - If I don't have to use my OneYearOut, I'm okay with leaving it out, I just thought it'd help)
So, in the above example, I want to summarize student A001 as having 12 credit hours and $800 in tuition; B001 as having 6 credit hours and $400 in tuition. (I hope that helps)
Thank you!
I pull my data using Power Query and I have a custom field [OneYearOut - calculated in PQ] that just adds a year to the [startdate] field. I also have built a relationship from my data to a calendar table.
My task is to look at all information within a year from a student's FIRST [startdate]. I know there are calculations using DATESBETWEEN and EARLIEST and LATEST, but all the examples I have seen on mrescel.com confuse me as to when to use the date in my data vs the related date in the calendar table.
[TABLE="width: 500"]
<tbody>[TR]
[TD]StudentID[/TD]
[TD]StartDate[/TD]
[TD]OneYearOut[/TD]
[TD]CourseCode[/TD]
[TD]CreditHours[/TD]
[TD]Total Tuition[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]3/15/2013[/TD]
[TD]3/15/2014[/TD]
[TD]ENG100[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]3/15/2103[/TD]
[TD]3/15/2014[/TD]
[TD]MATH101[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]6/30/2013[/TD]
[TD]6/30/2014[/TD]
[TD]SOC200[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]6/30/2013[/TD]
[TD]6/30/2014[/TD]
[TD]HIS300[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]A001[/TD]
[TD]4/15/2014[/TD]
[TD]4/15/2015[/TD]
[TD]MATH103[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]B001[/TD]
[TD]5/15/2014[/TD]
[TD]5/15/2015[/TD]
[TD]ENG100[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]B001[/TD]
[TD]8/31/2014[/TD]
[TD]8/31/2015[/TD]
[TD]PE202[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
[TR]
[TD]B001[/TD]
[TD]6/30/2015[/TD]
[TD]6/30/2016[/TD]
[TD]BUS105[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[/TR]
</tbody>[/TABLE]
(PS - If I don't have to use my OneYearOut, I'm okay with leaving it out, I just thought it'd help)
So, in the above example, I want to summarize student A001 as having 12 credit hours and $800 in tuition; B001 as having 6 credit hours and $400 in tuition. (I hope that helps)
Thank you!
Last edited: