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
ovetteabejuela
Impactful Individual
Impactful Individual

Simple Power Query Q: How to make a composite key

How do you combine two columns to produce a composite key:

 

I have a Date column and an Employee ID column and i'd like to format the date into YYYYMMDD

 

and the final result would then be YYYYMMDDXXXXXX where XXXXXX is the Employee ID.

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

Usually you can merge columns but I don't think that will give the right format.

 

So I would suggest to add a custom column with formula:

 

Date.ToText([Date],"yyyyMMdd")&Text.From([Employee ID])

 

Text.From is not required if Employee ID is text already, but you forgot to mention.

Specializing in Power Query Formula Language (M)

View solution in original post

2 REPLIES 2
MarcelBeug
Community Champion
Community Champion

Usually you can merge columns but I don't think that will give the right format.

 

So I would suggest to add a custom column with formula:

 

Date.ToText([Date],"yyyyMMdd")&Text.From([Employee ID])

 

Text.From is not required if Employee ID is text already, but you forgot to mention.

Specializing in Power Query Formula Language (M)

Thanks @MarcelBeug, small problem, BIG help!

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.