The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I'm trying to group tickets into product category based on comparing one table to another. The match on ticket type from one table to another isn't exact. It's more like if the ticket string string in Table 1(AA0765AA) contains a part of the one in Table 2 (765), then that will be classified as Bananas. It's not an exact comparison. The output table will look like this.
I suppose CONTAINSSTRING will work. However I can't seem to get the syntax right. I'm trying group Table 1 into Type and do some analysis. Can someone help me with this please? Model here.
Thanks in advance,
AM
Solved! Go to Solution.
hi @amani1980 ,
try to extract the numbers from the string
1) in Power Query, how:
https://monocroft.com/extract-numbers-from-a-string-in-power-bi/
2) If you insist to do it with DAX code and supposing the dataset is as uniform as we see in the sample, you can try to write a calculated column with DAX like:
ticket=
VALUE(MID(table1[Ticket No], 4, 4))
then try to join with table2 and use RELATED to get the type column.
Use Power Query and in the merge command check the fuzzy merging as highlighted below
hi @amani1980 ,
try to extract the numbers from the string
1) in Power Query, how:
https://monocroft.com/extract-numbers-from-a-string-in-power-bi/
2) If you insist to do it with DAX code and supposing the dataset is as uniform as we see in the sample, you can try to write a calculated column with DAX like:
ticket=
VALUE(MID(table1[Ticket No], 4, 4))
then try to join with table2 and use RELATED to get the type column.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |