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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Radek_Z
Advocate II
Advocate II

Create "sum of students" chart based on Start and End Dates of multiple training courses

Hi all,

 

I've been struggling with this one too long...time to ask the experts:

 

We run a school with training courses starting and ending at various days of the year. Each course has a different number of students enrolled. There are hundreds of courses, and some are planned up to a decade into the future.

 

Our challenge is that we need to know how many students we'll have enrolled at ANY DAY in the future, so we can ensure that we have enough instructors and classroom space prepared in advance.

 

I would like to create a "Sum of Students" line chart that sums the total number of students for ALL courses, based on the Course Start and Course End dates. Here's my sample data:

 

Course Name# of StudentsCouse Start DateCourse End Date
Course 1315-Apr-202203-Mar-2024
Course 2510-Aug-202229-Apr-2024
Course 3203-Mar-202304-Jan-2025
Course 4210-Oct-202325-Aug-2025
Course 5414-Jan-202413-May-2026

 

I would like to create a simple line chart, based on the below sample "expected result" table. I've simulated the X-axis using the above 10 dates (5 start dates and 5 end dates sorted ascending left to right, for demo purposes), and I've simulated the Y-axis as the "Line chart results" row which sums up ALL students that are actively enrolled in ALL the courses on a particular day, IF that day falls within the Course Start and Course End date.

I've mapped the 5 sample courses on the table to illustrate when the students are in training, and how the summing up is expected to happen.

 

Line chart results381012161613864
Course 1333333    
Course 2 555555   
Course 3  222222  
Course 4   222222 
Course 5    444444
 15-Apr-202210-Aug-202203-Mar-202310-Oct-202314-Jan-202403-Mar-202429-Apr-202404-Jan-202525-Aug-202513-May-2026

 

I would like the Y-axis to be ONE LINE representing the Sum of Students, and the X-axis to be a continuous date range based on my Date Table, something like this:

 

Radek_Z_1-1683128603131.png

 

Does anyone have an idea for how to accomplish this? Many thanks in advance.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Radek_Z , try if these approaches can help

Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM

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

2 REPLIES 2
Radek_Z
Advocate II
Advocate II

Wow, that did it. Thank you!

 

I had to watch the video slowly, and took my time replicating your approach with my dataset, but it did exactly what I was looking for.

The sum of Total Active Students measure was more complicated than expected, but it does make sense now that I see the "answer" in front of me. Thank you again, Amit!

amitchandak
Super User
Super User

@Radek_Z , try if these approaches can help

Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM

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