Forum Discussion

AndrewKent's avatar
AndrewKent
Helper I
9 years ago
Solved

Countif (or equivalent) Per Row in PowerQuery/Dax

Hi,

 

Apologies but although I can see several topics on this, I'm not sure how they fit to my specific issue. I have one table of data that I am modelling. The table contains records assessment attempts for staff. There are multiple rows for individuals. What I want to do is:

 

- In a new column [Attempts], carry out a countif on a column [Staff ID] for each row in the table (the Excel equivalent would be =COUNTIF([STAFF ID],A1) for each row.

 

- Remove duplicate rows in [Staff ID]

 

This should leave me with 1 record per staff member with an aggregated amount of of attempts in the [Attempts] column

 

Hope this makes sense.

 

Andy

  • Hi Andy

     

    Doing a Groupby can solve your problem. See the attached screenshot.GROUPBY

    EXPECTED OUTPUT

     

7 Replies