Power Query - Unstack data

Mathexcel

New Member
Joined
Jun 22, 2017
Messages
36
Hi MrExcel Community,

I am facing a new unstacking data challenge. ?

Context

I have a bunch of Property Names, two Attributes which are stacked together in the following order: (1) a date (in a text format) and (2) a percentage change and their Values.

Target

Here is that table format I am aiming to get:

Property NameDateValuePercentage
Property1Tue 07 Jan 2020
67​
-0.0944722​
Property1Wed 08 Jan 2020
67​
-0.0693152​

> I am thinking to add an index column to indicate if it is a Date or a Percentage, but don't have the skills to execute this query (yet).

Table Source
Here is a sample of the data source:
Property NameAttributeValue
Property1Tue 07 Jan 2020
67​
Property1Column5
-0.09447​
Property1Wed 08 Jan 2020
67​
Property1Column7
-0.06932​
Property2Thu 09 Jan 2020
59​
Property2Column9
-0.06349​
Property2Fri 10 Jan 2020
59​

Would anyone know how to transform this piece of data into the desired format?

I appreciate your precious time. ?

Matthieu
 
Legend!! ✌Thanks for the feedback, much appreciated!

I tried to punch into my model your Calendar Table but I'm not sure how this really works. It calls for Table1, which I don't have. I'll be grateful for further pointers as how to implement this.
> Do I need to create a table labelled as Table1 with the below headers and no data so the function fills it?

Headers: Date, Year, Month, Month Name, Quarter, Week of Year, Week of Month, Day, Day of Week, Day of Year, Day Name, Month Year, Week Year
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
That is a dynamic calendar...it feeds off of your fact table. Whatever the name of your table is...that's what you put into "Table1". And whatever the name of your date field is in that table...that's what you you put into "Attribute". You only have to do this in the start date and end date.
 
Upvote 0
Ok thanks. It's great to learn something here but I think I'm doing something wrong.

I'm not sure how to make these two work together. I created a blank query and pasted the 1st code there, but it says it cannot find Table1.
Could you give me some pointers on how to kick this off and to get this running?

Many many thanks.
MattExcel
 
Upvote 0
This is the error I am getting.
1579108483954.png
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top