POWERBI count How many student in different course

Viewed 37

I have table contain name course attendance

I want count how many student in different course

Output I want = 3 student because Ahmad have two different course

enter image description here

2 Answers

test this measure:

Result =
COUNTROWS ( SUMMARIZE ( TableName, TableName[name], TableName[course name] ) )

You can also add the 3rd column:

Alternative Solution :

Result =
COUNTROWS (
    SUMMARIZE (
        TableName,
        TableName[name],
        TableName[course name],
        TableName[attendence]
    )
)

If we test them, the result is the same:

JHK

SUMX(
    VALUES(tbl[course name])
    ,CALCULATE(
         COUNTROWS(VALUES(tbl[name]))
    )
)
Related