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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RodrigoAC
New Member

Count words in a string and Summary

Hello everyone!

 

I need help in building a dax to count, dynamically, a specific word in a string columm.

 

I got the example in Excel:

RodrigoAC_0-1644884675957.png

So i will put in a bar visual to count occurrences.

 

 

I tried to create another table with the indexes i need but i just can't get through it.

 

I've seen someone with the same question as me but i just can't duplicate the rows.

Really can't figure it out.

 

Did anyone have been throught it already?

 

Thanks!

 

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@RodrigoAC 

I suggest you to use PQ to get the result

1. split ocrruences by comma to rows

1.PNG

2. group by

2.PNG

3.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

TheoC
Super User
Super User

Hi @RodrigoAC 

 

1. Click on Transform Data in the ribbon to get to Power Query.

2. Then, in the Home tab, go to Split Column and click on By Delimeter.

3. Then, use the following criteria from below screenshot:

 

TheoC_0-1644886900514.png

4. Close and Apply.

5. Now just drag the Column with the words into the table.

6. Do the same as step 5 and then select "Count" on the second Column you brought in to give you the count of each.

 

Hope that helps 🙂

Theo

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

4 REPLIES 4
RodrigoAC
New Member

Thanks guys for the awsome solutions. I pointed them both as a solution for this problema since each one has a different kind of outputs and other uses.

That was pretty straightfoward and solved my case! Thanks to @TheoC  and @ryan_mayu for the fast reply!

Appreciate it!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




TheoC
Super User
Super User

Hi @RodrigoAC 

 

1. Click on Transform Data in the ribbon to get to Power Query.

2. Then, in the Home tab, go to Split Column and click on By Delimeter.

3. Then, use the following criteria from below screenshot:

 

TheoC_0-1644886900514.png

4. Close and Apply.

5. Now just drag the Column with the words into the table.

6. Do the same as step 5 and then select "Count" on the second Column you brought in to give you the count of each.

 

Hope that helps 🙂

Theo

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

ryan_mayu
Super User
Super User

@RodrigoAC 

I suggest you to use PQ to get the result

1. split ocrruences by comma to rows

1.PNG

2. group by

2.PNG

3.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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