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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Chetanab
Microsoft Employee
Microsoft Employee

Unpivoting multiple date columns

Hi,

 

I have a table like this - 

 

TitleRequest Start DateRequest End DateTargeted Start DateTargeted End DateActual Start DateActual End Date
Item 17/30/20219/30/20217/30/20219/30/20215/30/20217/30/2021
Item 27/30/20219/30/20217/30/20219/30/20215/30/2021

7/30/2021

 

I need to transform it to something like this

TitleDate CategoryStart DateEnd Date
Item 1Request Date7/30/20219/30/2021
Item 1Targeted Date7/30/20219/30/2021
Item 1Actual Date5/30/20217/30/2021
Item 2Request Date7/30/20219/30/2021
Item 2Targeted Date7/30/20219/30/2021
Item 2Actual Date5/30/20217/30/2021

 

I tried unpivoting all the start date columns and the end date columns from the first table but that gives me a cartesian product. IS there a way to do thi

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Select the first column. Unpivot the othe columns.

Split the centre column (by space, once as far left as possible)

Select the new column that has 'start date' and 'end date' in it. Pivot this column. Choose Value(the date column) as Values. Choose Don't Aggregate from the advanced.

That should be it.

View solution in original post

2 REPLIES 2
Chetanab
Microsoft Employee
Microsoft Employee

Perfect. Thank you.

HotChilli
Super User
Super User

Select the first column. Unpivot the othe columns.

Split the centre column (by space, once as far left as possible)

Select the new column that has 'start date' and 'end date' in it. Pivot this column. Choose Value(the date column) as Values. Choose Don't Aggregate from the advanced.

That should be it.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.