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
claret_mug
Frequent Visitor

using a % of column total value to create a new measure

Hello

 

I'm completely new to Power BI and I'm wondering if I can create a measure based on values that are being shown as a % of column total. I've spent ages trying wo figure out how to do this. 

My two measures are

Female Progression = CALCULATE([Total students],'Table1'[Collaborative Provision Indicator]="Non-collaborative",Table1[Course length 1 year or less]="No",Table1[Programme Level]="UG",Table1[Course Mode(FT/PT)]="Full-Time",Table1[Entry Route]="UCAS/GTTR",Table1[Programme Year]="One",Table1[Gender]="Female",Table1[Residency Home EU Overseas]="Home")
and
Male Progression = CALCULATE([Total students],'Table1'[Collaborative Provision Indicator]="Non-collaborative",Table1[Course length 1 year or less]="No",Table1[Programme Level]="UG",Table1[Course Mode(FT/PT)]="Full-Time",Table1[Entry Route]="UCAS/GTTR",Table1[Programme Year]="One",Table1[Gender]="Male",Table1[Residency Home EU Overseas]="Home")
 
These measures are in a matrix and broken down by a column called 'Progressed?' which tells me who has/hasn't progressed. When displayed in my matrix the values (as % of column total) are male progression=79.1% and female progression=85.5% and now I need a calculation that will show me that that percentage point difference is 6.4.
 
Would anyone know how to do this?
Many thanks
Laura 
1 ACCEPTED SOLUTION

HI @claret_mug ,

 

Create a Total Measure

 

VAR TOTAL =
CALCULATE (
    [Total students],
    'Table1'[Collaborative Provision Indicator] = "Non-collaborative",
    Table1[Course length 1 year or less] = "No",
    Table1[Programme Level] = "UG",
    Table1[Course Mode(FT/PT)] = "Full-Time",
    Table1[Entry Route] = "UCAS/GTTR",
    Table1[Programme Year] = "One",
    Table1[Residency Home EU Overseas] = "Home"
)

 

Create these Measures

 

Female % = Divide (Female Progression, Total)

Male % = Divide (Male Progression, Total)

 

Then create a final measure

 

% Change = Male% - Female%

 

Regards,

Harsh Nathani

 

 

View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@claret_mug 

please try to calculate the % by measure

female%=
VAR Female Progression = CALCULATE([Total students],'Table1'[Collaborative Provision Indicator]="Non-collaborative",Table1[Course length 1 year or less]="No",Table1[Programme Level]="UG",Table1[Course Mode(FT/PT)]="Full-Time",Table1[Entry Route]="UCAS/GTTR",Table1[Programme Year]="One",Table1[Gender]="Female",Table1[Residency Home EU Overseas]="Home")
VAR TOTAL=CALCULATE([Total students],'Table1'[Collaborative Provision Indicator]="Non-collaborative",Table1[Course length 1 year or less]="No",Table1[Programme Level]="UG",Table1[Course Mode(FT/PT)]="Full-Time",Table1[Entry Route]="UCAS/GTTR",Table1[Programme Year]="One",Table1[Residency Home EU Overseas]="Home")
RETURN DIVIDE(FEMALE PROGRESSION, TOTAL)

MALE%=
var Male Progression = CALCULATE([Total students],'Table1'[Collaborative Provision Indicator]="Non-collaborative",Table1[Course length 1 year or less]="No",Table1[Programme Level]="UG",Table1[Course Mode(FT/PT)]="Full-Time",Table1[Entry Route]="UCAS/GTTR",Table1[Programme Year]="One",Table1[Gender]="Male",Table1[Residency Home EU Overseas]="Home")
VAR TOTAL=CALCULATE([Total students],'Table1'[Collaborative Provision Indicator]="Non-collaborative",Table1[Course length 1 year or less]="No",Table1[Programme Level]="UG",Table1[Course Mode(FT/PT)]="Full-Time",Table1[Entry Route]="UCAS/GTTR",Table1[Programme Year]="One",Table1[Residency Home EU Overseas]="Home")
RETURN DIVIDE(Male PROGRESSION, TOTAL)

then create a measure : female%-male%





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

Proud to be a Super User!




amitchandak
Super User
Super User

@claret_mug , Can you share sample data and sample output in table format?

@claret_mug create another measure for the difference if I understood your question correctly and you can use this new measure in your visuals.

 

Difference = [Female Progression] - [Male Progression]

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k thanks so much for your reply. The problem with this is that is just gives me the number difference (598), rather than the percentage point difference which is what I need (6.4%)

Laura 

HI @claret_mug ,

 

Create a Total Measure

 

VAR TOTAL =
CALCULATE (
    [Total students],
    'Table1'[Collaborative Provision Indicator] = "Non-collaborative",
    Table1[Course length 1 year or less] = "No",
    Table1[Programme Level] = "UG",
    Table1[Course Mode(FT/PT)] = "Full-Time",
    Table1[Entry Route] = "UCAS/GTTR",
    Table1[Programme Year] = "One",
    Table1[Residency Home EU Overseas] = "Home"
)

 

Create these Measures

 

Female % = Divide (Female Progression, Total)

Male % = Divide (Male Progression, Total)

 

Then create a final measure

 

% Change = Male% - Female%

 

Regards,

Harsh Nathani

 

 

Hi @harshnathani thank you so much. I've managed to get what I need 🙂 

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.