Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply

Count e-mail addresses

I have a table that contains different SharePoint sites.
I have a column called Group.Owners where I have the e-mail address to the owner/owners of that site.
There can be none, one or multiple e-mail addresses in that column. And there are of course different values on each row.
The e-mail addresses all have @ and if there are more than one, they are separeted by a semicolon. 
Like this: person.1@domainone.com; person.2@domaintwo.com; person.33@dom.com

I want to, in the easiest way, count the number of e-mailaddresses on each row.
I thought the easiest way was to count how many times @ appears in that column on each row. But I cant figure out how to do this.

I need help! 

1 ACCEPTED SOLUTION

Because some cell is null in Group.Owners column, you can use following code:

List.Count(Text.PositionOf([Group.Owners] ?? "", "@", Occurrence.All))

 

View solution in original post

6 REPLIES 6
ZhangKun
Super User
Super User

Add a custom column,use following code:

List.Count(Text.PositionOf([Group.Owners], "@", Occurrence.All))

 

 

Oh, great solution, but I get this error:

Expression.Error: We cannot convert the value null to type Text.
Details:
    Value=
    Type=[Type]

Because some cell is null in Group.Owners column, you can use following code:

List.Count(Text.PositionOf([Group.Owners] ?? "", "@", Occurrence.All))

 

I can see the ?? "" replaces the null values with empty text. Is there any documentation available about what the ?? exactly does and if there are other options as well? I cannot find anything and was not aware of this functionality

you search "Coalesce" in this pageOperator behavior 

Works well no. Just needed to click "Don't summerize" when I added the values from that column in my table.

Thank you for the code and the help.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.