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

Defining categories from comments data

Hello. I have a data that contains comments from user for example:

1. The price is too high
2. Not suitable for my house
3. High price
4. The price is too expensive, other store offer lower price

5. The products is faulty

6. the products quality is bad

7. The price is too high and it's not suitable for my house

 

 

I'm trying to categorize the reason into a new columns called 'Categories'. The data will be for example: High Price, Quality Issues, Suitability Issues and such. I have used the IFERROR but it's not that efficient 

Price =

IF (
IFERROR ( SEARCH ( "pric", 'data'[comments] ), 0 )=0, BLANK(), "Price")
and for example the no 7 comment "The price is too high and it's not suitable for my house" has 2 reason which is High Price and Suitability.

Does anyone know how can I do this more efficiently? Thank you in advance.

btw my data is in csv format. 
1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

I would suggest  you may create a table2 as below. Then you may create the calculated column with CONCATENATEX Function. Here is the similar post for your reference.

 

Column =
CONCATENATEX (
    FILTER ( Table2, SEARCH ( Table2[Key], Table1[comment], 1, -1 ) > 0 ),
    Table2[Category],
    " and "
)

1.png

Regards,

Cherie

 

Community Support Team _ Cherie Chen
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

4 REPLIES 4
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

I would suggest  you may create a table2 as below. Then you may create the calculated column with CONCATENATEX Function. Here is the similar post for your reference.

 

Column =
CONCATENATEX (
    FILTER ( Table2, SEARCH ( Table2[Key], Table1[comment], 1, -1 ) > 0 ),
    Table2[Category],
    " and "
)

1.png

Regards,

Cherie

 

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you for your help! I'll try them

Ashish_Mathur
Super User
Super User

Hi,

 

See if my solution here helps - Search for multiple phrases within a cell and extract all those phrases in another column.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thank you for your help!

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.