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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
lukeguy12
Regular Visitor

Creating new table that merges mulitple date columns into multiple rows instead

Hello!

I'm working with a dataset that includes the below:

AddressDate 1Date 2Date 3Date 4
Fake Street, London01/01/202405/06/2022  
Real Street, Norwich05/05/202305/01/202101/01/2020 

To make working with dates easier, I want to create a new table which basically transposes the multiple date columns into multiple rows. So for example, my new table would look like the below:

AddressDate
Fake Street, London01/01/2024
Fake Street, London05/06/2022
Real Street, Norwich05/05/2023
Real Street, Norwich05/01/2021
Real Street, Norwich01/01/2020

Struggling to acheive this in the Desktop app and would appreciate any help. The dataset is tricky but it can't be changed without impacting the team's workflow and i'd rather not do that.

Thanks!

1 ACCEPTED SOLUTION
MNedix
Solution Supplier
Solution Supplier

Hi,

If you unpivot the other columns like in the screenshot below you will get the desired result.

 

If this answers your question then please mark it as the solution so others can see it.

transpose_2.jpgtranspose_3.jpg

View solution in original post

4 REPLIES 4
MNedix
Solution Supplier
Solution Supplier

Well, one way to do it is first to duplicate your table in Power Query (rightclick on table -> Duplicate), then unpivot, then delete the columns you're not interested in.

MNedix
Solution Supplier
Solution Supplier

Hi,

If you unpivot the other columns like in the screenshot below you will get the desired result.

 

If this answers your question then please mark it as the solution so others can see it.

transpose_2.jpgtranspose_3.jpg

Thank you for the quick reply! This gets me closer but having issue only having the values I need in the resulting columns. The other columns in the dataset are being included too. Any ideas?

 

Update: nevermind, solved it.

 

for those with similar issue, I simply did the following:

 

Transform Data > right click table > Reference > Removed all other columns in reference table > did the unpivot solution as suggested here.

That works too 🙂

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.