Forum Discussion

WJ876400's avatar
WJ876400
Helper IV
7 years ago
Solved

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.   ...
  • AlB's avatar
    7 years ago

    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).