cancel
Showing results for 
Search instead for 
Did you mean: 
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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.