PowerBI - Count number of rows with value as table user

Viewed 210

Not quite sure how to word this question, but I'll explain here:

I have a table that looks like this:

User Credits Tasks
John 100 5
Sam 50 3

These values are all coming from one table called taskbin.

I'm trying to add a column that looks up the count of rows with the user in a separate table called qabin.

The qabin table looks like this

QAID Submitter QAer
20 John Sam
21 Sam John

Basically, I need to get a count of the number of times John appears in the Submitter field of the qabin table.

I could add it to the table view so it looks like this:

User Credits Tasks Submitted Count
John 100 5 1
Sam 50 3 1

I tried just adding a count of submitter to the table view, but it shows the total number of rows instead of using the correct user as listed in the table.

Any help is appreciated.

2 Answers

If you Join taskbin to qabin table on the user, you can show the "User" value from taskbin and do a measure that counts the rows in qabin, in a table. Something like this might work

Submitted Count = CountRows('quadmin').

If these two tables are not connected for some reason

Column =
CALCULATE (
    COUNTX (
        FILTER ( qabin, qabin[Submitter] = CALCULATE ( MAX ( taskbin[User] ) ) ),
        qabin[Submitter]
    )
)

Solution

Related