Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello everyone
I have a student table similar to the below dummy columns that I'm trying to create a measure for. I'm trying to create a measure that will change it's calculation depending on the values in the column "Completion Years". The intent is to create a measure which will show the percentage of students, but the denominator will change depending on the column values of "File Source". Here's the measure that I have created so far:
Student Number | Graduation Status | Source | Completion Years |
101 | OT | On Time | 3 Years |
102 | OT | On Time | 3 Years |
103 | ET | Extended Time | 4 Years |
104 | ET | Extended Time | 5 Years |
105 | ET | Extended Time | 5 Years |
Solved! Go to Solution.
Try this measure:
VAR _compl_year = SELECTEDVALUE( Student[Completion Years] )
VAR _value =
SWITCH(
TRUE( ),
_compl_year = "3 Years",
DIVIDE(
CALCULATE( COUNTA( Student[Student Number] ), Student[Graduation Status] = "OT", Student[Source] = "On Time" ),
CALCULATE( COUNTA( Student[Student Number] ), Student[Graduation Status] = "OT", Student[Source] = "On Time" )
),
_compl_year IN { "4 Years", "5 Years" },
DIVIDE(
CALCULATE(
COUNTA( Student[Student Number] ),
Student[Graduation Status] IN { "OT", "ET" },
Student[Source] = "Extended Time"
),
CALCULATE(
COUNTA( Student[Student Number] ),
Student[Graduation Status] IN { "OT", "ET" },
Student[Source] = "Extended Time"
)
),
BLANK( )
)
RETURN
_value
Best regards
Bruno Costa | Power Participant
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
You can also check out BI4ALL's website and our data solutions!
Best regards
Bruno Costa | Super User
Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!!
Take a look at the blog: PBI Portugal
Try this measure:
VAR _compl_year = SELECTEDVALUE( Student[Completion Years] )
VAR _value =
SWITCH(
TRUE( ),
_compl_year = "3 Years",
DIVIDE(
CALCULATE( COUNTA( Student[Student Number] ), Student[Graduation Status] = "OT", Student[Source] = "On Time" ),
CALCULATE( COUNTA( Student[Student Number] ), Student[Graduation Status] = "OT", Student[Source] = "On Time" )
),
_compl_year IN { "4 Years", "5 Years" },
DIVIDE(
CALCULATE(
COUNTA( Student[Student Number] ),
Student[Graduation Status] IN { "OT", "ET" },
Student[Source] = "Extended Time"
),
CALCULATE(
COUNTA( Student[Student Number] ),
Student[Graduation Status] IN { "OT", "ET" },
Student[Source] = "Extended Time"
)
),
BLANK( )
)
RETURN
_value
Best regards
Bruno Costa | Power Participant
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
You can also check out BI4ALL's website and our data solutions!
Best regards
Bruno Costa | Super User
Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!!
Take a look at the blog: PBI Portugal
This was really helpful.
Thank you so much for your time and input.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
15 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |