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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ukare1996
Helper I
Helper I

How to union two date columns into one

Hi,

I have two columns that I would like to UNION into one column (like how you'd do in SQL) - is there any way to do this in Power BI. I dont want to merge them - I just need them combined into one column.

ukare1996_0-1677156331744.png

Thanks in advance :

2 ACCEPTED SOLUTIONS
serpiva64
Solution Sage
Solution Sage

Hi,

starting from this

serpiva64_1-1677159912934.png

insert a step after

serpiva64_2-1677159991006.png

and modify your step this way

=Table.ToColumns( #"Changed Type")

retransform to table

serpiva64_3-1677160093583.pngserpiva64_4-1677160112103.png

and expand to new rows

serpiva64_5-1677160146866.png

then remove duplicates

serpiva64_6-1677160187299.png

change type to date

serpiva64_7-1677160221952.png

 and sort ascending

serpiva64_8-1677160265609.png

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

 

 

 

 

 

you can use a conditional column

 

View solution in original post

Peter_Beck
Resolver II
Resolver II

Hi -

 

Here is a simple solution using M-code:

 

This assumes you have a table represented by a query called "Dates", it has 2 columns - Date1 and Date2:

 

let
Col1 = Dates[Date1], //  Creates a column object from Date1 of the table Dates
Col2 = Dates[Date2], // Creates a column object from Date2 of the table Dates
NewTable1 = Table.FromColumns({Col1}), // Creates a new table made up only of column 1
NewTable2 = Table.FromColumns({Col2}), // Creates a new table made up only of column 2
NewTable3 = Table.Combine({NewTable1,NewTable2}) // Uses the Table.Combine function - merges the 2 tables

in
NewTable3 // Returns the new table

 

Hope this helps!

 

Peter

View solution in original post

3 REPLIES 3
ukare1996
Helper I
Helper I

Both solutions worked. Thanks both 🙂

Peter_Beck
Resolver II
Resolver II

Hi -

 

Here is a simple solution using M-code:

 

This assumes you have a table represented by a query called "Dates", it has 2 columns - Date1 and Date2:

 

let
Col1 = Dates[Date1], //  Creates a column object from Date1 of the table Dates
Col2 = Dates[Date2], // Creates a column object from Date2 of the table Dates
NewTable1 = Table.FromColumns({Col1}), // Creates a new table made up only of column 1
NewTable2 = Table.FromColumns({Col2}), // Creates a new table made up only of column 2
NewTable3 = Table.Combine({NewTable1,NewTable2}) // Uses the Table.Combine function - merges the 2 tables

in
NewTable3 // Returns the new table

 

Hope this helps!

 

Peter

serpiva64
Solution Sage
Solution Sage

Hi,

starting from this

serpiva64_1-1677159912934.png

insert a step after

serpiva64_2-1677159991006.png

and modify your step this way

=Table.ToColumns( #"Changed Type")

retransform to table

serpiva64_3-1677160093583.pngserpiva64_4-1677160112103.png

and expand to new rows

serpiva64_5-1677160146866.png

then remove duplicates

serpiva64_6-1677160187299.png

change type to date

serpiva64_7-1677160221952.png

 and sort ascending

serpiva64_8-1677160265609.png

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

 

 

 

 

 

you can use a conditional column

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.