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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mumair
Helper I
Helper I

How to Count Multiple Values in the Same Cell

The way we imported the data set wasn't the best and now we are left with a column that looks something like this:

 

Failed Tanks

5S, 5P

1SP, 2SP, 3SP

N/A

7S

 

And so on. The cells which have an N/A or just one tank is not a problem. The cells that have 2 or more tanks though are confusing me. I was wondering if there was a way to output the following:

 

Count of Failed Tanks

2

3

0

1

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mumair,

 

I think power query will be suitbale to achieve your requirement:

 

Logic: if "Failed Tanks" equal to 'N/A', return 0; other cases, split text with ',' to list and count it.

 

    #"Added Custom" = Table.AddColumn(#"Promoted Headers", "Custom", each if [Failed Tanks]<> "N/A" then List.Count(Text.Split([Failed Tanks],",")) else 0)

 

2.PNG

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @mumair,

 

I think power query will be suitbale to achieve your requirement:

 

Logic: if "Failed Tanks" equal to 'N/A', return 0; other cases, split text with ',' to list and count it.

 

    #"Added Custom" = Table.AddColumn(#"Promoted Headers", "Custom", each if [Failed Tanks]<> "N/A" then List.Count(Text.Split([Failed Tanks],",")) else 0)

 

2.PNG

 

Regards,

Xiaoxin Sheng

Thank you! Worked perfectly

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors