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
Anonymous
Not applicable

Extract #hashtags from the data in a column to a new column in the same table

Hello community,

 

I am working on a social media project where I have to filter all the posts based on the hashtags. I have a column which shows me the posts and the hashtags used all together in one column as shown below

 

I would like to scrape the hashtags and put them all in a new column and later use that column as filter for the report.

 

jpatel_0-1648509089663.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

You can use replace value in the first step. For example.

vcgaomsft_1-1648781122079.png

Replace value.

vcgaomsft_0-1648781043087.png

Value to find: #+space, Replace with: #

vcgaomsft_2-1648781211785.png

vcgaomsft_3-1648781327264.png

Split Column by Delimiter.

vcgaomsft_4-1648781464406.png

vcgaomsft_5-1648781515250.png

Remove unwanted columns.

vcgaomsft_6-1648781570539.png

Close and apply.

Attach the PBIX file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems with it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

4 REPLIES 4
mahoneypat
Microsoft Employee
Microsoft Employee

You could use an expression like this in a custom column to return the hashtags as a list (after which you can expand those to new rows, concatenate them back together, etc.).

 

= List.Select(Text.Split([TextColumn]), " "), each Text.Start(_,1) = "#")

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi @mahoneypat , where should we put the formula? I tried to add as custom column, but does not work. What did I do wrong? Thank you. 

Anonymous
Not applicable

What if I have data like - # Logo Design so basically there is a space between # and Logo. How do I split in that case?

Anonymous
Not applicable

Hi @Anonymous ,

 

You can use replace value in the first step. For example.

vcgaomsft_1-1648781122079.png

Replace value.

vcgaomsft_0-1648781043087.png

Value to find: #+space, Replace with: #

vcgaomsft_2-1648781211785.png

vcgaomsft_3-1648781327264.png

Split Column by Delimiter.

vcgaomsft_4-1648781464406.png

vcgaomsft_5-1648781515250.png

Remove unwanted columns.

vcgaomsft_6-1648781570539.png

Close and apply.

Attach the PBIX file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems with it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors