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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.