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

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.

Reply
cher90
Helper II
Helper II

Is it a good idea to merge columns to achieve a faster join?

Hello!

 

Is it a good idea to merge columns to achieve a faster join?

 

The idea would be to merge the columns with a specific delimiter, and keep only a large column and the ID column.

 

And then just split the big column by the delimiter chosen to have each column.

 

What do you think ? have you ever tested this?

 

Exemple 

 

cher90_0-1667396290546.png

 

 

Thanks!

1 ACCEPTED SOLUTION
AKNiang
Frequent Visitor

Hi,

 

Is it necessary the merge to get an unique value as result of the merge?

 

If not I don't get the point of merging the columns

 

Thanks

 

 

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @cher90 ,

According to your description, here's my solution.

1.Select the three columns at the same time(Ctrl+click), then click Transform>Merge Columns.

vkalyjmsft_0-1667459535235.png

In the Separator option, you can select "Custom" and enter the symbol.

vkalyjmsft_1-1667459611437.png

Result:

vkalyjmsft_2-1667459775531.png

2. If you want to split the merged column, click Transform>Split Column>By Delimiter.

vkalyjmsft_3-1667459851839.png

Enter the custom delimiter in the dialog.

vkalyjmsft_4-1667459885464.png

Result:

vkalyjmsft_5-1667460026129.png

Here's the whole M syntax, you can copy-paste in a blank query to see the details.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUoEAiCVBARAKhkIlGJ1opWMyJIywSEVCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Col1 = _t, Col2 = _t, Col3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Col1", type text}, {"Col2", type text}, {"Col3", type text}}),
    #"Merged Columns" = Table.CombineColumns(#"Changed Type",{"Col1", "Col2", "Col3"},Combiner.CombineTextByDelimiter("--", QuoteStyle.None),"Colx"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Merged Columns", "Colx", Splitter.SplitTextByDelimiter("--", QuoteStyle.Csv), {"Colx.1", "Colx.2", "Colx.3"})
in
    #"Split Column by Delimiter"

I also attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AKNiang
Frequent Visitor

Hi,

 

Is it necessary the merge to get an unique value as result of the merge?

 

If not I don't get the point of merging the columns

 

Thanks

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors