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
Syndicate_Admin
Administrator
Administrator

Calculated columns in a table

Good afternoon

I have a question about how to calculate a graduation or dropout rate for a cohort of students who share a common phase of entry of several degrees.

I have this calculation done in Excel and Accés but I do not do it well in DAX, especially if I filter the data by gender or other filters.

To calculate these two fees I use a table that contains all the records of the students one by one by course, center, degree, gender and final state of the student when doing the calculation. this state can have 3 values "Abandon", "Enrolled" or "Titled". Based on these 3 states, the graduation rate is calculated by adding the total number of graduates by the sum of the total number of students of each degree by center and course. This gives a percentage which is the rate.

Also to facilitate the calculations I have created 4 calculated columns, one has the value 1 in each record, to count the students of each degree.

The other 3 columns are "T"itulado", "Matriculado" or "Abandono". The value 1 o 0 applies to the column, depending on whether the student is qualified, enrolled or has dropped out. If the final state corresponds to the calculated column, the value will be 1 and if not it will be 0.

This works in a table with dax calculations if the input and the final result correspond to the same titration.

To calculate the graduation and dropout rate I have created several measures that add up the total number of graduates in the table:

T_Estudiants_Tit = sum('Tab_Cohort_Global_UPC Work'[Graduates])

Total dropouts:

T_Estudiants_Aban = sum('Tab_Cohort_Global_UPC Work'[Abandonment])

Total students:

T_Estudiants = sum('Tab_Cohort_Global_UPC Work'[Total_Estudiant])

and the tases are calculated by dividing the above measures

Graduation Rate = divide([T_Estudiants_Tit],[T_Students],0)

Dropout Rate = divide([T_Estudiants_Aban],[T_Estudiants],0)

This works well for a degree that does not have a common entry phase.

But if the entry of students is done through a common phase, in which students begin their first-year studies, in the same bag of degrees, things get complicated.

This bag or common phase of degrees can be formed by 2, 3, 4 or 5 different degrees.

The problem comes with students who, being part of the common phase of the first year, leave their studies in the first year, without moving on to the degree they have chosen to study.

These students have to be redistributed proportionally among the degrees that are part of the common phase, and this is where the calculations that I have applied do not work because they do not contain that redistribution of students who have remained in the common phase.

The distribution is made according to the number of students who pass to each degree in the second year, regardless of whether they later graduate, continue enrolled or abandon the studies of the degree they have chosen.

Example:

We have a common phase of 5 degrees, in which 224 students enter. Of these, 158 pass the first year and the other 66 remain in the common phase. These 66 are the ones that must be redistributed proportionally among the 5 degrees. The redistribution would be made in relation to the 158 students who have passed the first year, ejemplo:

To the "Degree A" pass 10 students, of which 5 are graduated, 5 enrolled and 0 dropouts.

To the "Degree B" pass 26 students, of which 10 are graduated, 16 enrolled and 0 dropouts.

To the "Degree C" pass 49 students, of which 34 are graduated, 13 enrolled and 3 dropouts.

To the "Degree D" pass 42 students, of which 28 are graduated, 14 enrolled and 0 dropouts.

To the "Degree E" pass 31 students, of which 18 are graduated, 12 enrolled and 1 dropouts.

The proportional part of the A degree is 10/158 * 66, the part of the B degree is 26/158 * 66 and so on.

Golemor_0-1646410700665.png

How do I calculate these ratios in DAX and then apply it to the calculation of graduation and dropout rates and that I can filter by gender or other filters?

Thank you very much for your collaboration.

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Good afternoon

I'm having trouble pasting the data from the Excel table, into the post and I don't know how to attach the file, to the Power BI community.
I send you the data in an attached Excel. Please tell me how I can add an Excel file in the Post.
Thanks a lot.
Carlos

Maybe you can use one of the internet file services?

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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.