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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
gakka9272
New Member

Questions about relation

Questions about relation Please tell me how to relate the relation with multiple items. Currently, only one item can be related between tables.

1 ACCEPTED SOLUTION
stretcharm
Memorable Member
Memorable Member

Create a composite key by joining fields.

 

I tend combine the fields with a | delimiter

 

e.g.  Here I duplicate columns in the Query Editor then combine them. You can also do the same by creating a Custom Column, however you need to cast to text first.

    #"Duplicated Column1" = Table.DuplicateColumn(#"Changed Type1", "Store Code", "Store Code - Copy"),
    #"Duplicated Column" = Table.DuplicateColumn(#"Duplicated Column1", "Date", "Date - Copy"),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Duplicated Column", {{"Store Code - Copy", type text}, {"Date - Copy", type text}}, "en-GB"),{"Store Code - Copy", "Date - Copy"},Combiner.CombineTextByDelimiter("|", QuoteStyle.None),"StoreDateKey"),
    #"Added Custom1" = Table.AddColumn(#"Merged Columns", "StoreDateKey1", each Number.ToText([Store Code]) & "|" & Date.ToText([Date]))


You can also do it in Dax by created a computed column

StoreKey3 = Actual[Store Code] & "|" & FORMAT(Actual[Date], "YYYYMMDD") 

These can then be used in Query editor merges or Relationships.

View solution in original post

2 REPLIES 2
stretcharm
Memorable Member
Memorable Member

Create a composite key by joining fields.

 

I tend combine the fields with a | delimiter

 

e.g.  Here I duplicate columns in the Query Editor then combine them. You can also do the same by creating a Custom Column, however you need to cast to text first.

    #"Duplicated Column1" = Table.DuplicateColumn(#"Changed Type1", "Store Code", "Store Code - Copy"),
    #"Duplicated Column" = Table.DuplicateColumn(#"Duplicated Column1", "Date", "Date - Copy"),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Duplicated Column", {{"Store Code - Copy", type text}, {"Date - Copy", type text}}, "en-GB"),{"Store Code - Copy", "Date - Copy"},Combiner.CombineTextByDelimiter("|", QuoteStyle.None),"StoreDateKey"),
    #"Added Custom1" = Table.AddColumn(#"Merged Columns", "StoreDateKey1", each Number.ToText([Store Code]) & "|" & Date.ToText([Date]))


You can also do it in Dax by created a computed column

StoreKey3 = Actual[Store Code] & "|" & FORMAT(Actual[Date], "YYYYMMDD") 

These can then be used in Query editor merges or Relationships.

thank you

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors