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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jose_cruzrodz
Frequent Visitor

How to count each instance of a value in a single column but for all records

Hello.

 

My source data has two columns. The first one is a Unique ID (no duplicates) and the second is a list of individual Codes, separated by comma, within each cell. Each individual Code can show up in my dataset mutiple times. Look at the following screenshot:

 

jose_cruzrodz_0-1716335395765.png

 

For example, Codes 0101 and 0104 show up in records 1, 4, 6 and others. We see records with only one Code but others have multiple codes. All that is fine.

 

What I want to accomplish is knowing how many times Code 0101, for example, has come up in my dataset. The answer to my question is 16 times. I want to be able to complete this count for every Code. Another example, Code 0224 is listed 6 times, while Code 0203 is listed 8 times.

 

My final visual will be a simple table that has all Codes listed in a column A and the count in column B. Something like this:

jose_cruzrodz_1-1716336405756.png

 

Is this possible? Thank you!

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

The standard answer here is to split the column by delimiter (from the Power Query interface). Choose 'To Rows' and your data will be in a more structured format.

You can then use simple aggregations to get the figures you want.

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

The standard answer here is to split the column by delimiter (from the Power Query interface). Choose 'To Rows' and your data will be in a more structured format.

You can then use simple aggregations to get the figures you want.

Hi! Thanks for your reply. Yes, a couple minutes after I submitted my inquiry I found the "To Rows" option hidding within the Advanced area. I used it and as you suggested, it sorted the data in a way that I was able to properly manage and get the results that I needed. Excellent. Thanks!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.