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.
Hi,
I have been solving the categorization case for some time. The case is therefore:
I have an mapping table (MapTable) where the order is important.
Keyword | Brand | Index |
e-tron | Electric CAR | 0 |
sportback | Sport CAR | 1 |
Q6 | SUV | 2 |
4x | FourCross CAR | 3 |
citycarver | City CAR | 4 |
Also I have Product Table (Products).
Product |
A1_citycarver_s-tronic_e-tron |
A1_citycarver_s-tronic_TSI |
A1_citycarver_s-tronic_TSI_4x |
A6_sportback_s-tronic_TSI_4x |
A6_avant_s-tronic_TSI_4x |
Q6_sportback_s-tronic_TSI_4x |
Q6_avant_s-tronic_TSI_e-tron |
Q6_family_s-tronic_TSI_4x |
Based on keyword from MapTable I need to assign Brand. As is known, LOOKUPVALUE function works with native sorting, you cannot specify another column in MapTable for sorting. So after using this function you get wrong Brand values.
Brand =
LOOKUPVALUE(MapTable[Brand],MapTable[Keyword],FIRSTNONBLANK(FILTER(VALUES(MapTable[Keyword]),SEARCH(MapTable[Keyword],Products[Product],1,0)),1))
Second option I often use is that I am using all columns in filter, then I also need to get only specified column result as "search_value".
Brand Sorted =
LOOKUPVALUE(MapTable[Brand],MapTable[Keyword],SELECTCOLUMNS(FIRSTNONBLANK(FILTER(VALUES(MapTable),SEARCH(MapTable[Keyword],Products[Product],1,0)),1),"search_value",MapTable[Keyword]))
I hope the second option works, but does anyone have any other solution?
The result seems like:
Your feedback is welcome!
Thank you,
Petr
@PetrP , Not very clear to me.
You can also try like
Minx(filter(MapTable, SEARCH(MapTable[Keyword],Products[Product],,0)>0),MapTable[Brand])
@amitchandak Your formula just searching by native search, not based on search keyword ranking (index).
This means I need to use such a mechanism that iterate all keywords in MapTable row by row by Index rank. E.g..: search e-tron, if not found then search sportback etc.. If any keyword is searched, use the Brand column.
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 |
---|---|
49 | |
26 | |
21 | |
16 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |