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
Anonymous
Not applicable

Need help to create a fixed denominator to calculate %

Hi, 

I have this data and this is how 1 enrollment looks like:

1.PNG

From this dataset, I created a chart with the absolute value like this. Basically, this is to see if all of the students join in 2020-01 stay with the learning center for how long and how many of them are left after a period of time. The Cohort Rank is the order of the month that the students are still staying with us.

2.PNG

 

What I am trying to do is to turn this into Percentage. But I really struggle with making the denominator to be fixed ( the first row). For example for Cohort 2020-01, I need all of the months after that to divide by 521. I tried to filter the Denominator with the Cohort rank =1 but I get nothing for the 2nd month afterward. So I only get 1st month 100% and infinity after that T.T

3.PNG

For example for 2020-01: I need the 1st month to be 100%, the 2nd month is 518/521 = 99% and 3rd month 514/521. 

 

I really need help with this!!!

 

Thanks a lot and I really appreciate your help. 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @FrankAT

 

My Numerator is actually not a column. I am trying to do a measure for this. 

This is the measure that I use for the Numerator = DISTINCTCOUNT( Cohort[ENR ID (Product + ST IDs)])
So I am having my 
VAR Numerator = DISTINCTCOUNT( Cohort[ENR ID (Product + ST IDs)])
And I need a
VAR Denominator = the fixed number for "cohort rank =1" from the numerator above
 
I hope you understand my explanation 😅
 
 
 
 

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try this:

Percent = 
VAR Denominator =
    CALCULATE ( [Numerator], Cohort[Cohort Rank] = 1 )
RETURN
    DIVIDE ( [Numerator], Denominator )

percen.JPG

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

FrankAT
Community Champion
Community Champion

Hi @Anonymous 

with an excerpt of your sample data:

 

05-10-_2020_15-05-49.png

 

Percentage  to Cohort Rank 1 = 
VAR _Denominator = CALCULATE(VALUES('Table'[2020-01]),'Table'[Cohort Rank] = 1)
RETURN
    DIVIDE(SUM('Table'[2020-01]),_Denominator)

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Anonymous
Not applicable

Hi @FrankAT

 

My Numerator is actually not a column. I am trying to do a measure for this. 

This is the measure that I use for the Numerator = DISTINCTCOUNT( Cohort[ENR ID (Product + ST IDs)])
So I am having my 
VAR Numerator = DISTINCTCOUNT( Cohort[ENR ID (Product + ST IDs)])
And I need a
VAR Denominator = the fixed number for "cohort rank =1" from the numerator above
 
I hope you understand my explanation 😅
 
 
 
 

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.