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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jocy
Frequent Visitor

Enrollment Renovation: Identify students with enrollment in previous year

Hi all,

I'm wondering if i can get help with this, I'm working with a school's database and I have the "Enrollment Table" with:

  • Student ID
  • Enrollment Year (2016, 2017, 2018, etc)
  • Cursus ID

That means that every year, each student got a new register in the database, identifying the year and the actual cursus assigned.

 

And I need to calculate how many of the actual enrolled students where enrolled from past year, my biggest issue is that the formula must work for any selected year.

 

Please if someone can help me! Thx

1 ACCEPTED SOLUTION

Hi @jocy,

 

Try this measure:

 

Enrollment previous year =
VAR select_year =
    MAX ( 'Enrollment Table'[Enrollment Year] )
VAR students =
    VALUES ( 'Enrollment Table'[Student ID] )
RETURN
    COUNTROWS (
        FILTER (
            SUMMARIZE (
                ALL ( 'Enrollment Table'[Student ID]; 'Enrollment Table'[Enrollment Year] );
                'Enrollment Table'[Enrollment Year];
                'Enrollment Table'[Student ID]
            );
            'Enrollment Table'[Enrollment Year]
                = select_year - 1
                && 'Enrollment Table'[Student ID] IN students
        )
    )

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
jocy
Frequent Visitor

Hi all,

I'm wondering if i can get help with this, I'm working with a school's database and I have the "Enrollment Table" with:

  • Student ID
  • Enrollment Year (2016, 2017, 2018, etc)
  • Cursus ID

That means that every year, each student got a new register in the database, identifying the year and the actual cursus assigned.

 

And I need to calculate how many of the actual enrolled students where enrolled from past year, my biggest issue is that the formula must work for any selected year.

 

Please if someone can help me! Thx

Hi @jocy,

 

Try this measure:

 

Enrollment previous year =
VAR select_year =
    MAX ( 'Enrollment Table'[Enrollment Year] )
VAR students =
    VALUES ( 'Enrollment Table'[Student ID] )
RETURN
    COUNTROWS (
        FILTER (
            SUMMARIZE (
                ALL ( 'Enrollment Table'[Student ID]; 'Enrollment Table'[Enrollment Year] );
                'Enrollment Table'[Enrollment Year];
                'Enrollment Table'[Student ID]
            );
            'Enrollment Table'[Enrollment Year]
                = select_year - 1
                && 'Enrollment Table'[Student ID] IN students
        )
    )

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @jocy,

 

Believe that this post is repeated with:

 

https://community.powerbi.com/t5/Desktop/Enrollment-Renovation-Rate/m-p/474635#M220706

 

Regards,

Mfelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



jocy
Frequent Visitor

@MFelix Thanks for your help, is exactly what I was looking for and your answer was very fast.

 

I had a couple issues last days when posting on the forum, so I couldn't fix my repeated post or thank you sooner!.

 

Thx again!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.