Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Tim01425
Frequent Visitor

Return value that match a list of specific list of keywords

I have two tables - example:

 

Tim01425_0-1689117394896.png

 and

Tim01425_1-1689117420416.png

I'm looking to add a 2 columns in table1 for matching existing keyworkds (case insensitive) and code from Table2.

The expected results should look like this:

 Tim01425_2-1689117708616.png

Is this something that can be done?

Thank you

 

1 REPLY 1
ThxAlot
Super User
Super User

 

let
    Table1 = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCshJzFMwVYrViVZyTE5OLS5WKMlXSMtMzUkpBgtWgAGYWQBSmpZfpABRCBYzLkpRKEvNS8kvAnNDihIz8zLz0hVyE/NKE3OAamIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [FileName = _t]),
    Table2 = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCshJzFPSUXI0MDBUitWJVgopSszMy8xLB4o5GRgYgcUck5NTi4uBIs4GBpZgkbDUvJT8IqBIpIGBqVJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Keywords = _t, Code = _t]),


    KWs = Table.ToRows(Table2),
    #"Added Column" = Table.AddColumn(
            Table1,
            "col",
            each Table.FromColumns(List.Transform(List.Zip(List.Accumulate(KWs, {}, (s,c) => if Text.Contains([FileName], c{0}, Comparer.OrdinalIgnoreCase) then s & {c} else s)), each {Text.Combine(_, ",")}))
    ),
    #"Expanded col" = Table.ExpandTableColumn(#"Added Column", "col", {"Column1", "Column2"}, {"Keywords", "Code"})

in
    #"Expanded col"

 

ThxAlot_0-1689123234857.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.