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.
Hello All,
I need a help from the powerbi community members
I have two tables, Table 1 has multiple texts separated by comma in rows, Table 2 has texts in columns
Table 1
Sweets, Vegetables, Fruits, Meat
Table 2
Sweets
Vegetables
Fruits
Meat
I need to create a new column in Table 1 which should now compare the two tables, if the table 1 row (Sweets, Vegetables, Fruits, Meat) matches with all the text with a specific column in table 2 then the results should be displayed as "OK"
Thanks for your help
Mechi 🔧
Solved! Go to Solution.
Hello Vimal,
Thanks for your effors and support in sharing the knowledge and solutions 😊
Finally we had arrived to a solution using power query, Posted the solution in Power Query Forum, Link to solution
BR
Mechi 🔧
@Mechi please try concatenatex function
Column 2 = IF(CONCATENATEX(Table2,Table2[tbl2Col],", ",Table1[Column])=Table1[Column],"Ok")
Hi Vimal,
Thanks for your reply and solution
I was looking for a solution for the below example (snap), i haven't mentioned in detail in my earlier post
Thanks for the feedback
BR
Mechi 🔧
Column = IF(SUMX(Table2,FIND(LOWER(Table2[List 1]),LOWER(Table1[ITEMS]),,0))>0,"Ok","Not Ok")
@Mechi Please create this column in Table1.
It should compare the each word, but the formula finds & compares the first character and not the words
Mechi 🔧
Hi @Mechi Thanks for poiting out that. Fixed that issue. Can you please try below one
Column =
VAR countOfMatchingElement = DIVIDE(LEN(SUBSTITUTE(CONCATENATEX(Table2,CONTAINSSTRING(Table1[ITEMS],Table2[List 1])),"FALSE","")),4,0)
VAR countOfDelimiter = (LEN(Table1[ITEMS])-LEN(SUBSTITUTE(Table1[ITEMS],",","")))+1
RETURN IF((countOfDelimiter-countOfMatchingElement)<>0,"Not ok","Ok")
Hi Vimal,
Thanks for your efforts 👍
The results are almost close, except the one with exact string match for the last one
Mechi 🔧
Hi @Nathaniel_C , @Mariusz Sorry for tagging.
Any input how to resolve this problem
List 1
Sweets |
Fruits |
Furnitures |
Clothes |
Vegetables |
Meat |
Flowers |
Toys |
Forest |
ITEMS
Sweets, Vegetables, Fruits, Meat |
Flowers, Toys, Drinks |
Furnitures, Clothes |
Forests |
Hello Vimal,
Thanks for your effors and support in sharing the knowledge and solutions 😊
Finally we had arrived to a solution using power query, Posted the solution in Power Query Forum, Link to solution
BR
Mechi 🔧
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
19 |