Forum Discussion

BBHouston's avatar
BBHouston
Helper I
5 years ago
Solved

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?

 

  • BBHouston , new column in table 1

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

2 Replies

  • BBHouston , new column in table 1

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