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
enzos
Frequent Visitor

Search for specific text values from a dictionary column

Hi, I'm trying to recreate an excel report to PBI. What i am having troubles recreating is the dictionary table which allows us to search for an specific keyphrase in Table A and categorize them into groups.

 

Example:

 

Table A

 

Incident NumberSubmit DateDescription
Incident0014/1/2020Ice cream machine broken again
Incident0024/2/2020Candy Machine is low on chocolate bars
Incident0034/3/2020Washing machine on Floor b not working
Incident0044/4/2020Low on paper floor 1

 

Dictionary Table

 

KeyPhrase 1KeyPhrase 2Display as Category
Ice creamMachineRepairs - Maintanence
CandyMachineRepairs - Maintanence
WashingMachineRepairs - Maintanence
Paper Restock

 

Then we run some macros that would search the description column in Table A to find any matches in the dictionary table from KeyPhrase1 and KeyPhrase2, if there is a match then the category would be added as an extra column.

 

Table A

 

Incident NumberSubmit DateDescriptionCategory
Incident0014/1/2020Ice cream machine broken againRepairs - Maintanence
Incident0024/2/2020Candy Machine is low on chocolate barsRepairs - Maintanence
Incident0034/3/2020Washing machine on Floor b not workingRepairs - Maintanence
Incident0044/4/2020Low on paper floor 1Restock

 

I was able to find a similar problem here but the user wanted the fix to be done in M, however i want it to be done using DAX if possible as we would be manually adding more information to the dictionary table.

 

Thank you in advance ! 🙂 

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @enzos,

I'd like to suggest you take a look at the following blog about string Comparison in power bi DAX expressions:

From SQL to DAX: String Comparison 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi,

 

I read through the article but sadly i coudlnt find something that could help, what im looking for is a way to search a column against another column, and if it finds a match to then give me the corresponding category.

 

I am looking for a way to find a keyphrase from table dictionary in column description from Table A, and if there is a match with one of the keyphrases to match it and pull the corresponding category.

 

I could create multiple columns that each search for a keyphrase but as we add more and more keyphrases that would be inefficient.

 

 

HI @enzos,

According to your description, I think you may need 'machine learning' or AI insight to recognize and analyze your table records instead of manually checking and replace text with DAX formula. You can take a look at the following document to know more about these:

Use AI Insights in Power BI Desktop 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
dkpmfa
Helper II
Helper II

Anyway, where I'm going with that is, if you have a limited number of search words, you can add a column to your table for each search word like this:

 

SearchField1 = SEARCH("<keyword to search for>",'<your table>'[<column to search>],1,0)

 

Then you will either have a 0 in the column if the keyword isn't in the field being searched or a non-0 if it is. 

dkpmfa
Helper II
Helper II

Do you have a finite number of key words to look for?

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.

Top Solution Authors