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
WJ876400
Helper IV
Helper IV

Averages

Hi

 

I have a list of teachers and students and there students current status like below. What I want to do is calculate percentages based on their status so I can see a withdrawn status.

 

The list is similar to thisThe list is similar to thisThis is the outcome I am looking forThis is the outcome I am looking for

 

Any help is appreciated, thanks

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @WJ876400 

Assuming students appear only once per teacher, try this:

1. Place Table1[Teacher] in the rows on  a matrix visual

2. Place Table1[Status] in the columns of the matrix visual

3. Create this measure, format as %, and place it in values of the matrix

Measure =
DIVIDE (
    COUNT ( Table1[Student] ),
    CALCULATE ( COUNT ( Table1[Student] ), ALL ( Table1[Status] ) )
)

Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).

View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@WJ876400  Try matrix visual as below

 

image.pngimage.pngimage.png





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

Proud to be a PBI Community Champion




AlB
Super User
Super User

Hi @WJ876400 

Assuming students appear only once per teacher, try this:

1. Place Table1[Teacher] in the rows on  a matrix visual

2. Place Table1[Status] in the columns of the matrix visual

3. Create this measure, format as %, and place it in values of the matrix

Measure =
DIVIDE (
    COUNT ( Table1[Student] ),
    CALCULATE ( COUNT ( Table1[Student] ), ALL ( Table1[Status] ) )
)

Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).

Thanks @AlB  that worked. Thank you for the tip on sharing data so it can be tested

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.