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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Splitting Text Column - Tables

Hi,

 

Unsure if this is the correct placing for this question. I essentially have data similar to the below:

 

Date|Quote|Product

01.01.22|001|A, B

01.01.22|002|A, B, C

01.01.22|003|B

01.01.22|004|A, C

01.01.22|005|A

01.01.22|006|B, A

 

From the above, I want to create a table that would count how many times A, B and C would appear. So the expected result would be as below:

 

Product|Count

A|5

B|4

C|3

 

I can split the data lines for example but that will mean I will have to create three different tables as B for example will appear in column 1 and column 2. Thanks in advance!

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Step 1:

vzhangti_2-1646986939390.png

Step 2:

vzhangti_3-1646986968791.png

Step 3:

vzhangti_4-1646987025937.png

Step 3:

Measure:

Count = 
CALCULATE(COUNT('Table'[Product]),FILTER(ALL('Table'),[Product]=SELECTEDVALUE('Table'[Product])))

vzhangti_5-1646987537675.png

Is this the result you were expecting?

 

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Step 1:

vzhangti_2-1646986939390.png

Step 2:

vzhangti_3-1646986968791.png

Step 3:

vzhangti_4-1646987025937.png

Step 3:

Measure:

Count = 
CALCULATE(COUNT('Table'[Product]),FILTER(ALL('Table'),[Product]=SELECTEDVALUE('Table'[Product])))

vzhangti_5-1646987537675.png

Is this the result you were expecting?

 

Best Regards,

Community Support Team _Charlotte

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

PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

I would use Power Query to split and unpivot this data so you get a separate row for each product.

It can be done in one 'Split Column By Delimiter' step.  You'll need to expand the Advanced Options and choose rows.

PaulOlding_0-1646768651132.png

that will give you a table that looks like this

PaulOlding_1-1646768731550.png

and finally you can use a measure that does COUNTROWS(Table) to give you how many times the products appear.

 

Whitewater100
Solution Sage
Solution Sage

Hi:

Besides in Power Query, here is one DAX solution.

You can make three calc columns in your table. One for each letter. Here's an example, I named your table "Table":

A's = LEN(Data[Product])
- LEN(SUBSTITUTE( SUBSTITUTE(Data[Product], "a", ""), "A", ""))
 Whitewater100_0-1646755482116.png

 

 
 
Then do 3 measures to sum them: Here's the first one:
No A's = SUM(Data[A's])

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.