Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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.
Thanks in advance :
Solved! Go to Solution.
Hi,
starting from this
insert a step after
and modify your step this way
=Table.ToColumns( #"Changed Type")
retransform to table
and expand to new rows
then remove duplicates
change type to date
and sort ascending
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
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
Both solutions worked. Thanks both 🙂
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
Hi,
starting from this
insert a step after
and modify your step this way
=Table.ToColumns( #"Changed Type")
retransform to table
and expand to new rows
then remove duplicates
change type to date
and sort ascending
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
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
35 | |
17 | |
12 | |
11 | |
9 |
User | Count |
---|---|
44 | |
27 | |
16 | |
14 | |
13 |