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
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
Employee
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
Employee
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
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.

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.