cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gingerclaire
Helper III
Helper III

Count number of attendees based on non blank attendee name fields

I have a table for an appointment and it has columns as follows for each event (each row):

 

Attendee 1 name

Attendee 2 name

Attendee 3 name

Attendee 4 name

Attendee 5 name

Attendee 6 name

(all the way to 16!)

 

I need a measure to count the number of attendees at each appointment - by counting the non blanks in the name field.

 

I am completely stuck on how to do this - please can you help?

3 REPLIES 3
djurecicK2
Resident Rockstar
Resident Rockstar

First I would consider unpivoting that table:

 

https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-9d95-f5882...

 


If this post helps, then please consider accepting it as the solution to help other members find it more quickly.
djurecicK2
Resident Rockstar
Resident Rockstar

Hi @gingerclaire ,

 You should be able to use the COUNTA function to do this.

(Adapt for your table and field names)

 

Number of Attendees= COUNTA(Table[FieldName])

 

https://learn.microsoft.com/en-us/dax/counta-function-dax

Counts the number of rows in the specified column that contain non-blank values.

 

Please consider accepting as solution if this answers the question- thanks!


If this post helps, then please consider accepting it as the solution to help other members find it more quickly.

Thank you - I need to be able to do this across multiple fields for the table as below (I actually have 16 attendee fields):

 Attendee1nameAttendee2nameAttendee3nameAttendee4nameAttendee5nameAttendee6nameTotal attendees
Event 1JohnSarahJamesGeoff  4
Event 2HelenBob    2

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!