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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
n007jl
Frequent Visitor

Eliminating combination pairs from two columns

Hi Everyone,

 

Running in to a bit of an issue with removing duplicating combinations between two columns. How do I go about picking one report_id in this case and find all the linked_to_report_id associated with it?

 

report_idlinked_to_report_id
92fbffdf-582d-42ad-affd-bb8fc420edf487132845-fd6e-41ed-9ef7-939e7f11da25
e3bed3b5-ff78-4411-ab4a-1eb3f92f6e2a92fbffdf-582d-42ad-affd-bb8fc420edf4
87132845-fd6e-41ed-9ef7-939e7f11da2592fbffdf-582d-42ad-affd-bb8fc420edf4
92fbffdf-582d-42ad-affd-bb8fc420edf4e3bed3b5-ff78-4411-ab4a-1eb3f92f6e2a

 

End result:

 

92fbffdf-582d-42ad-affd-bb8fc420edf487132845-fd6e-41ed-9ef7-939e7f11da25
92fbffdf-582d-42ad-affd-bb8fc420edf4e3bed3b5-ff78-4411-ab4a-1eb3f92f6e2a

or

92fbffdf-582d-42ad-affd-bb8fc420edf487132845-fd6e-41ed-9ef7-939e7f11da25;e3bed3b5-ff78-4411-ab4a-1eb3f92f6e2a

 

Thanks,

James

 

1 ACCEPTED SOLUTION
jbwtp
Memorable Member
Memorable Member

Hi @n007jl ,

 

You can do something like this:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUUpWitWJVkoCshLBrGQ4CySbpBQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [id = _t, link = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"id", type text}, {"link", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Filter", each List.Sort({[id], [link]})),
    #"Removed Duplicates" = Table.Distinct(#"Added Custom", {"Filter"})
in
    #"Removed Duplicates"

Kind regards,

John

View solution in original post

2 REPLIES 2
jbwtp
Memorable Member
Memorable Member

Hi @n007jl ,

 

You can do something like this:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUUpWitWJVkoCshLBrGQ4CySbpBQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [id = _t, link = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"id", type text}, {"link", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Filter", each List.Sort({[id], [link]})),
    #"Removed Duplicates" = Table.Distinct(#"Added Custom", {"Filter"})
in
    #"Removed Duplicates"

Kind regards,

John

n007jl
Frequent Visitor

Thanks! I think this would work nicely.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

Top Solution Authors
Top Kudoed Authors