cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors