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.
I have:
1. a table of product purchases (np = around 160,000 records) with several fields including a text description field, and
2. a separate list of keywords (nk = around 90 rows) and partial keywords like "fuse" and "calibrat" (which covers "calibrate", "calibration", "calibrating", etc). The keyword list may be added to.
I need:
- a table of purchases where the description field contains at least one of the keywords in the list.
Is there an easy way to do this?
My thought was to do the following:
1. full outer join of the two tables to get one row for each keyword for every purchase, so that I would have (np * nk) rows,
2. add new column with a text search of the keyword in the description
3. filter where the text search yields a true
4. remove duplicate purchase records
However I have been stumped on how to do a full outer join without a matching column....
OK so while I was typing that last line I had a brainwave. I was stuck on how to join the two tables without a matching column so I just created a column in each table with "1" as the value for all rows and joined on those columns. That gave me the full outer join and I continued from #2 above and got my filtered list.
I'm still curious to find out if there's an easier way than that, as it seems like a rather sledgehammer approach to the nut that I have.
Thoughts?
Solved! Go to Solution.
This article might be a solution for your problem:
Hi @scign,
You can try to use below formula to get the matched table.(I found some ideas to modify my formula from @drewlewis15's link)
Matched Table = CALCULATETABLE(Records,FILTER(ADDCOLUMNS(Records,"Contains",FIRSTNONBLANK(FILTER(VALUES(Keywords[Keyword]), SEARCH(Keywords[Keyword],[Description],1,0)),[Keyword])),[Contains]<>BLANK()))
Regards,
Xiaoxin Sheng
Hi @scign,
You can try to use below formula to get the matched table.(I found some ideas to modify my formula from @drewlewis15's link)
Matched Table = CALCULATETABLE(Records,FILTER(ADDCOLUMNS(Records,"Contains",FIRSTNONBLANK(FILTER(VALUES(Keywords[Keyword]), SEARCH(Keywords[Keyword],[Description],1,0)),[Keyword])),[Contains]<>BLANK()))
Regards,
Xiaoxin Sheng
Hi,
Share a dataset and show the expected result.
This article might be a solution for your problem:
If you want to full join 2 tables without matching key column, you can just add a custom column with the other table, like:
= Table.AddColumn(Table1,"Table2", each Table2)
An alternative solution for your requirements would be to split your descriptions on any of the keywords and then take the results that have multiple items, like:
= Table.SelectRows(Source, each List.Count(Splitter.SplitTextByAnyDelimiter(Keywords)([Description])) > 1)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |