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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
gabrielvigo
Helper I
Helper I

Composite keys

Hello everyone.

 

I'm trying to put together a composite key between two fields from the query editor. But it returns error, and I am using the correct syntax.

 

For example, I have two fields "date" and "market".

 

Formula: [Fecha] & " " & [Market]

Expression: = Table.AddColumn(#"Columnas quitadas1", "Key", each [Fecha] & " " & [Market])

 

Expression.Error: The & operator can not be applied to the Date and Text types.

Details:
Operator=&
Left=1/4/2018
Right=

 

How can I join two fields of different types for the composite key?

 

Thanks!

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @gabrielvigo,

 

Try it like this:

Table.AddColumn(#"Changed Type", "key", each [Market] & " " & Text.From([Fecha]))

Composite_keys

 

Best Regards,

Dale

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

View solution in original post

1 REPLY 1
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @gabrielvigo,

 

Try it like this:

Table.AddColumn(#"Changed Type", "key", each [Market] & " " & Text.From([Fecha]))

Composite_keys

 

Best Regards,

Dale

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

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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