megera716
Board Regular
- Joined
- Jan 3, 2013
- Messages
- 146
- Office Version
- 365
- Platform
- Windows
I'm pretty savvy to Unpivot, Split Column and Pivot Columns within Power Query but I'm really struggling with this one. Hoping I'm missing something obvious or just doing my steps in the wrong order
I have a table like so with data from 2013-2019 (3 columns for every year with Member/Sales/Rep):
I am trying to get it into a table format that will look like this (thinking I would split the Member/Sales/Rep columns with a year in it on 4 characters to isolate the year) so that I can pivot by rep or year or whatever I fancy:
I have tried seemingly every iteration of selecting or not selecting columns, unpivoting selected or unpivoting other. I think my last try, I selected just the sales and rep columns for each year, Unpivot Selected and ended up with this:
Not what I'm going for . Can someone please advise as to what columns I should select/not select and what steps? Thank you in advance!
I have a table like so with data from 2013-2019 (3 columns for every year with Member/Sales/Rep):
Customer Name | Customer Type | 2013 Member | 2013 Sales | 2013 Rep | 2014 Member | 2014 Sales | 2014 Rep | 2015... |
Apple | ABC | Y | 15000 | SJ | Y | 25000 | SJ | |
XYZ | N | 0 | Y | 10000 | CD |
I am trying to get it into a table format that will look like this (thinking I would split the Member/Sales/Rep columns with a year in it on 4 characters to isolate the year) so that I can pivot by rep or year or whatever I fancy:
Customer Name | Customer Type | Year | Member | Sales | Rep |
Apple | ABC | 2013 | Y | 15000 | SJ |
Apple | ABC | 2014 | Y | 25000 | SJ |
XYZ | 2013 | N | 0 | ||
XYZ | 2014 | Y | 10000 | CD |
I have tried seemingly every iteration of selecting or not selecting columns, unpivoting selected or unpivoting other. I think my last try, I selected just the sales and rep columns for each year, Unpivot Selected and ended up with this:
Customer Name | Customer Type | Attribute | Value |
Apple | ABC | 2013 Sales | 15000 |
Apple | ABC | 2013 Rep | SJ |
Apple | ABC | 2014 Sales | 25000 |
Apple | ABC | 2014 Rep | SJ |
XYZ | 2013 Sales | 0 | |
XYZ | 2013 Rep | ||
XYZ | 2014 Sales | 10000 | |
XYZ | 2014 Rep | CD |
Not what I'm going for . Can someone please advise as to what columns I should select/not select and what steps? Thank you in advance!