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
felipetorresv
Regular Visitor

Issue with DAX formula at calculate first year's student retention

Hi all the community,

I'm writing becasue I have the following issue:pic 1pic 1Y have the following matrix (pic), showing the number of freshmen student per cohort and their presence trought next years (for example, in cohort 2017, there was 147 and for that set of students, in 2018 there was 123 and today there is 108 (third year) students.

I want to show the same matrix but with the first year's retention, second year retention an so on. I tried with the following DAX formula:

Retención_6_años = VAR 
Year1 = CALCULATE(COUNT(Hoja1[ALU_RUT]);FILTER(ALLSELECTED(Hoja1[AÑO_CURSADO_ING_CARRERA]);Hoja1[AÑO_CURSADO_ING_CARRERA]=1))
RETURN DIVIDE(COUNT(Hoja1[ALU_RUT]);Year1)

where the values of the column "AÑO_CURSADO_ING_CARRERA" of my dataset are the columns of the matrix (pic 1).
BUT, the result are as follows (pic 2)pic2.JPG:

 

as yo can see, the first result, 119.23%, should be the result of (155/177), but is clearly not correct. 

Help please!! 

Many thanks in advance...

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@felipetorresv 

 

You may check if DISTINCTCOUNT works.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.