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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BBHouston
Helper I
Helper I

How do create a measure for a table using a sum calculation from another table?

For example, let's say I have two tables. The first one is 'Dates':

SchoolDate
School A10/15
School A10/22
School B10/11
School B10/18
School C10/12
School C10/19

 

The second one is 'Enrollment':

SchoolEnrollment Date
School A10/11
School A10/12
School A10/12
School A10/13
School A10/21
School B10/9
School B10/9
School B10/10
School B10/17
School B10/18
School C10/11
School C10/12
School C10/19
School C10/19

 

I want an output that generates the number of 'Enrollment' rows BEFORE OR THE DAY OF the specific school and date in 'Dates' table, so it should look something like this:

SchoolDate Cumulative
School A10/154
School A10/225
School B10/113
School B10/185
School C10/122
School C10/194


Is there a measure I can write where this table visual is possible?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@BBHouston , new column in table 1

countx(filter(table2, Table2[School]= table1[School] && table2[Enrollment Date] <= Table1[Date]),Table2[School])

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
amitchandak
Super User
Super User

@BBHouston , new column in table 1

countx(filter(table2, Table2[School]= table1[School] && table2[Enrollment Date] <= Table1[Date]),Table2[School])

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

@amitchandakIt worked!! Thank you thank you! 🙂 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors