Power Query to arrange 8 Different Headers as two different columns

ashish128

New Member
Joined
Apr 6, 2016
Messages
21
Office Version
  1. 2019
Platform
  1. Windows
Dear All,

Greetings for the day!

I have a Table (BB Code Below)

I tried Power Query (Data From Range) and Achieved to have UnPivot the columns and then duplicate the Attribute and Value Columns but I do not know how to proceed further.

Kindly advice and guide.

Actual Data

Ashish-Dipika Data.xlsx
ABCDEFGHIJKLMN
1Regional ManagerRegional Manager idCountrySchoolDivisionPlacement Cycle-YearTarget Core Q1Target Core Q2Target Core Q3Target Core Q4Actual Core Q1Actual Core Q2Actual Core Q3Actual Core Q4
2J.laxmi0051e000005GtrDUnited KingdomManagementBtech202489881251
3srivatsan N0051e000005RVY4SpainLiberal ArtsMtech202598992142
4Ishu M0051e000005S5wCIndiaEngineeringB.Sc202679773233
5Praba k0051e000005Ga3iSouth AfricaManagementB.A202767661341
6Anandh N0051e000005QwvhUnited KingdomLiberal ArtsM.sc202886882152
7Dia A0051e000005Sl8iSpainEngineeringB.Com202998993263
8kishorkumartest P0051e000005UKX1IndiaManagementBBA203077774354
9tony chris0051e000005UFP7South AfricaLiberal ArtsMBA203166665145
10Rahul Registrar0055h00000BBU9WUnited KingdomEngineeringBtech203288885235
11J.laxmi0051e000005GtrDSpainManagementMtech203399994244
12srivatsan N0051e000005RVY4IndiaManagementB.Sc203477993153
13Ishu M0051e000005S5wCSouth AfricaLiberal ArtsB.A203566882262
14Praba k0051e000005Ga3iIndiaEngineeringM.sc203688661341
15Anandh N0051e000005QwvhSouth AfricaManagementB.Com203779882132
16Dia A0051e000005Sl8iIndiaLiberal ArtsBBA203867993243
17kishorkumartest P0051e000005UKX1South AfricaEngineeringBtech203986881351
18tony chris0051e000005UFP7IndiaManagementMtech204098992162
19Rahul Registrar0055h00000BBU9WSouth AfricaLiberal ArtsB.Sc204179773253
20J.laxmi0051e000005GtrDIndiaEngineeringB.A204269661341
21srivatsan N0051e000005RVY4South AfricaManagementM.sc204388882432
22Ishu M0051e000005S5wCIndiaManagementB.Com204496993543
23Praba k0051e000005Ga3iSouth AfricaLiberal ArtsBBA204578774554
24Anandh N0051e000005QwvhIndiaEngineeringMBA204669665465
25Dia A0051e000005Sl8iSouth AfricaManagementBtech204787885355
26kishorkumartest P0051e000005UKX1IndiaLiberal ArtsMtech204896994214
27tony chris0051e000005UFP7South AfricaEngineeringB.Sc204998993323
28Rahul Registrar0055h00000BBU9WIndiaManagementB.A205087882132
Sheet1


Achieved so far,

Ashish-Dipika Data.xlsx
ABCDEFGH
1Regional ManagerRegional Manager idCountrySchoolDivisionPlacement Cycle-YearAttributeValue
2J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Target Core Q18
3J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Target Core Q29
4J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Target Core Q38
5J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Target Core Q48
6J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Actual Core Q11
7J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Actual Core Q22
8J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Actual Core Q35
9J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Actual Core Q41
10srivatsan N0051e000005RVY4SpainLiberal ArtsMtech2025Target Core Q19
11srivatsan N0051e000005RVY4SpainLiberal ArtsMtech2025Target Core Q28
12srivatsan N0051e000005RVY4SpainLiberal ArtsMtech2025Target Core Q39
13srivatsan N0051e000005RVY4SpainLiberal ArtsMtech2025Target Core Q49
14srivatsan N0051e000005RVY4SpainLiberal ArtsMtech2025Actual Core Q12
15srivatsan N0051e000005RVY4SpainLiberal ArtsMtech2025Actual Core Q21
16srivatsan N0051e000005RVY4SpainLiberal ArtsMtech2025Actual Core Q34
17srivatsan N0051e000005RVY4SpainLiberal ArtsMtech2025Actual Core Q42
18Ishu M0051e000005S5wCIndiaEngineeringB.Sc2026Target Core Q17
19Ishu M0051e000005S5wCIndiaEngineeringB.Sc2026Target Core Q29
20Ishu M0051e000005S5wCIndiaEngineeringB.Sc2026Target Core Q37
21Ishu M0051e000005S5wCIndiaEngineeringB.Sc2026Target Core Q47
22Ishu M0051e000005S5wCIndiaEngineeringB.Sc2026Actual Core Q13
23Ishu M0051e000005S5wCIndiaEngineeringB.Sc2026Actual Core Q22
24Ishu M0051e000005S5wCIndiaEngineeringB.Sc2026Actual Core Q33
25Ishu M0051e000005S5wCIndiaEngineeringB.Sc2026Actual Core Q43
26Praba k0051e000005Ga3iSouth AfricaManagementB.A2027Target Core Q16
27Praba k0051e000005Ga3iSouth AfricaManagementB.A2027Target Core Q27
28Praba k0051e000005Ga3iSouth AfricaManagementB.A2027Target Core Q36
29Praba k0051e000005Ga3iSouth AfricaManagementB.A2027Target Core Q46
30Praba k0051e000005Ga3iSouth AfricaManagementB.A2027Actual Core Q11
31Praba k0051e000005Ga3iSouth AfricaManagementB.A2027Actual Core Q23
32Praba k0051e000005Ga3iSouth AfricaManagementB.A2027Actual Core Q34
33Praba k0051e000005Ga3iSouth AfricaManagementB.A2027Actual Core Q41
34Anandh N0051e000005QwvhUnited KingdomLiberal ArtsM.sc2028Target Core Q18
35Anandh N0051e000005QwvhUnited KingdomLiberal ArtsM.sc2028Target Core Q26
36Anandh N0051e000005QwvhUnited KingdomLiberal ArtsM.sc2028Target Core Q38
37Anandh N0051e000005QwvhUnited KingdomLiberal ArtsM.sc2028Target Core Q48
38Anandh N0051e000005QwvhUnited KingdomLiberal ArtsM.sc2028Actual Core Q12
39Anandh N0051e000005QwvhUnited KingdomLiberal ArtsM.sc2028Actual Core Q21
40Anandh N0051e000005QwvhUnited KingdomLiberal ArtsM.sc2028Actual Core Q35
41Anandh N0051e000005QwvhUnited KingdomLiberal ArtsM.sc2028Actual Core Q42
42Dia A0051e000005Sl8iSpainEngineeringB.Com2029Target Core Q19
43Dia A0051e000005Sl8iSpainEngineeringB.Com2029Target Core Q28
44Dia A0051e000005Sl8iSpainEngineeringB.Com2029Target Core Q39
45Dia A0051e000005Sl8iSpainEngineeringB.Com2029Target Core Q49
46Dia A0051e000005Sl8iSpainEngineeringB.Com2029Actual Core Q13
47Dia A0051e000005Sl8iSpainEngineeringB.Com2029Actual Core Q22
48Dia A0051e000005Sl8iSpainEngineeringB.Com2029Actual Core Q36
49Dia A0051e000005Sl8iSpainEngineeringB.Com2029Actual Core Q43
50kishorkumartest P0051e000005UKX1IndiaManagementBBA2030Target Core Q17
51kishorkumartest P0051e000005UKX1IndiaManagementBBA2030Target Core Q27
52kishorkumartest P0051e000005UKX1IndiaManagementBBA2030Target Core Q37
53kishorkumartest P0051e000005UKX1IndiaManagementBBA2030Target Core Q47
54kishorkumartest P0051e000005UKX1IndiaManagementBBA2030Actual Core Q14
55kishorkumartest P0051e000005UKX1IndiaManagementBBA2030Actual Core Q23
56kishorkumartest P0051e000005UKX1IndiaManagementBBA2030Actual Core Q35
57kishorkumartest P0051e000005UKX1IndiaManagementBBA2030Actual Core Q44
58tony chris0051e000005UFP7South AfricaLiberal ArtsMBA2031Target Core Q16
59tony chris0051e000005UFP7South AfricaLiberal ArtsMBA2031Target Core Q26
60tony chris0051e000005UFP7South AfricaLiberal ArtsMBA2031Target Core Q36
61tony chris0051e000005UFP7South AfricaLiberal ArtsMBA2031Target Core Q46
62tony chris0051e000005UFP7South AfricaLiberal ArtsMBA2031Actual Core Q15
63tony chris0051e000005UFP7South AfricaLiberal ArtsMBA2031Actual Core Q21
64tony chris0051e000005UFP7South AfricaLiberal ArtsMBA2031Actual Core Q34
65tony chris0051e000005UFP7South AfricaLiberal ArtsMBA2031Actual Core Q45
66Rahul Registrar0055h00000BBU9WUnited KingdomEngineeringBtech2032Target Core Q18
67Rahul Registrar0055h00000BBU9WUnited KingdomEngineeringBtech2032Target Core Q28
68Rahul Registrar0055h00000BBU9WUnited KingdomEngineeringBtech2032Target Core Q38
69Rahul Registrar0055h00000BBU9WUnited KingdomEngineeringBtech2032Target Core Q48
70Rahul Registrar0055h00000BBU9WUnited KingdomEngineeringBtech2032Actual Core Q15
71Rahul Registrar0055h00000BBU9WUnited KingdomEngineeringBtech2032Actual Core Q22
72Rahul Registrar0055h00000BBU9WUnited KingdomEngineeringBtech2032Actual Core Q33
73Rahul Registrar0055h00000BBU9WUnited KingdomEngineeringBtech2032Actual Core Q45
74J.laxmi0051e000005GtrDSpainManagementMtech2033Target Core Q19
75J.laxmi0051e000005GtrDSpainManagementMtech2033Target Core Q29
76J.laxmi0051e000005GtrDSpainManagementMtech2033Target Core Q39
77J.laxmi0051e000005GtrDSpainManagementMtech2033Target Core Q49
78J.laxmi0051e000005GtrDSpainManagementMtech2033Actual Core Q14
79J.laxmi0051e000005GtrDSpainManagementMtech2033Actual Core Q22
80J.laxmi0051e000005GtrDSpainManagementMtech2033Actual Core Q34
81J.laxmi0051e000005GtrDSpainManagementMtech2033Actual Core Q44
82srivatsan N0051e000005RVY4IndiaManagementB.Sc2034Target Core Q17
83srivatsan N0051e000005RVY4IndiaManagementB.Sc2034Target Core Q27
84srivatsan N0051e000005RVY4IndiaManagementB.Sc2034Target Core Q39
85srivatsan N0051e000005RVY4IndiaManagementB.Sc2034Target Core Q49
86srivatsan N0051e000005RVY4IndiaManagementB.Sc2034Actual Core Q13
87srivatsan N0051e000005RVY4IndiaManagementB.Sc2034Actual Core Q21
88srivatsan N0051e000005RVY4IndiaManagementB.Sc2034Actual Core Q35
89srivatsan N0051e000005RVY4IndiaManagementB.Sc2034Actual Core Q43
90Ishu M0051e000005S5wCSouth AfricaLiberal ArtsB.A2035Target Core Q16
91Ishu M0051e000005S5wCSouth AfricaLiberal ArtsB.A2035Target Core Q26
92Ishu M0051e000005S5wCSouth AfricaLiberal ArtsB.A2035Target Core Q38
93Ishu M0051e000005S5wCSouth AfricaLiberal ArtsB.A2035Target Core Q48
94Ishu M0051e000005S5wCSouth AfricaLiberal ArtsB.A2035Actual Core Q12
95Ishu M0051e000005S5wCSouth AfricaLiberal ArtsB.A2035Actual Core Q22
96Ishu M0051e000005S5wCSouth AfricaLiberal ArtsB.A2035Actual Core Q36
97Ishu M0051e000005S5wCSouth AfricaLiberal ArtsB.A2035Actual Core Q42
98Praba k0051e000005Ga3iIndiaEngineeringM.sc2036Target Core Q18
99Praba k0051e000005Ga3iIndiaEngineeringM.sc2036Target Core Q28
100Praba k0051e000005Ga3iIndiaEngineeringM.sc2036Target Core Q36
101Praba k0051e000005Ga3iIndiaEngineeringM.sc2036Target Core Q46
102Praba k0051e000005Ga3iIndiaEngineeringM.sc2036Actual Core Q11
103Praba k0051e000005Ga3iIndiaEngineeringM.sc2036Actual Core Q23
104Praba k0051e000005Ga3iIndiaEngineeringM.sc2036Actual Core Q34
105Praba k0051e000005Ga3iIndiaEngineeringM.sc2036Actual Core Q41
106Anandh N0051e000005QwvhSouth AfricaManagementB.Com2037Target Core Q17
107Anandh N0051e000005QwvhSouth AfricaManagementB.Com2037Target Core Q29
108Anandh N0051e000005QwvhSouth AfricaManagementB.Com2037Target Core Q38
109Anandh N0051e000005QwvhSouth AfricaManagementB.Com2037Target Core Q48
110Anandh N0051e000005QwvhSouth AfricaManagementB.Com2037Actual Core Q12
111Anandh N0051e000005QwvhSouth AfricaManagementB.Com2037Actual Core Q21
112Anandh N0051e000005QwvhSouth AfricaManagementB.Com2037Actual Core Q33
113Anandh N0051e000005QwvhSouth AfricaManagementB.Com2037Actual Core Q42
114Dia A0051e000005Sl8iIndiaLiberal ArtsBBA2038Target Core Q16
115Dia A0051e000005Sl8iIndiaLiberal ArtsBBA2038Target Core Q27
116Dia A0051e000005Sl8iIndiaLiberal ArtsBBA2038Target Core Q39
117Dia A0051e000005Sl8iIndiaLiberal ArtsBBA2038Target Core Q49
118Dia A0051e000005Sl8iIndiaLiberal ArtsBBA2038Actual Core Q13
119Dia A0051e000005Sl8iIndiaLiberal ArtsBBA2038Actual Core Q22
120Dia A0051e000005Sl8iIndiaLiberal ArtsBBA2038Actual Core Q34
121Dia A0051e000005Sl8iIndiaLiberal ArtsBBA2038Actual Core Q43
122kishorkumartest P0051e000005UKX1South AfricaEngineeringBtech2039Target Core Q18
123kishorkumartest P0051e000005UKX1South AfricaEngineeringBtech2039Target Core Q26
124kishorkumartest P0051e000005UKX1South AfricaEngineeringBtech2039Target Core Q38
125kishorkumartest P0051e000005UKX1South AfricaEngineeringBtech2039Target Core Q48
126kishorkumartest P0051e000005UKX1South AfricaEngineeringBtech2039Actual Core Q11
127kishorkumartest P0051e000005UKX1South AfricaEngineeringBtech2039Actual Core Q23
128kishorkumartest P0051e000005UKX1South AfricaEngineeringBtech2039Actual Core Q35
129kishorkumartest P0051e000005UKX1South AfricaEngineeringBtech2039Actual Core Q41
130tony chris0051e000005UFP7IndiaManagementMtech2040Target Core Q19
131tony chris0051e000005UFP7IndiaManagementMtech2040Target Core Q28
132tony chris0051e000005UFP7IndiaManagementMtech2040Target Core Q39
133tony chris0051e000005UFP7IndiaManagementMtech2040Target Core Q49
134tony chris0051e000005UFP7IndiaManagementMtech2040Actual Core Q12
135tony chris0051e000005UFP7IndiaManagementMtech2040Actual Core Q21
136tony chris0051e000005UFP7IndiaManagementMtech2040Actual Core Q36
137tony chris0051e000005UFP7IndiaManagementMtech2040Actual Core Q42
138Rahul Registrar0055h00000BBU9WSouth AfricaLiberal ArtsB.Sc2041Target Core Q17
139Rahul Registrar0055h00000BBU9WSouth AfricaLiberal ArtsB.Sc2041Target Core Q29
140Rahul Registrar0055h00000BBU9WSouth AfricaLiberal ArtsB.Sc2041Target Core Q37
141Rahul Registrar0055h00000BBU9WSouth AfricaLiberal ArtsB.Sc2041Target Core Q47
142Rahul Registrar0055h00000BBU9WSouth AfricaLiberal ArtsB.Sc2041Actual Core Q13
143Rahul Registrar0055h00000BBU9WSouth AfricaLiberal ArtsB.Sc2041Actual Core Q22
144Rahul Registrar0055h00000BBU9WSouth AfricaLiberal ArtsB.Sc2041Actual Core Q35
145Rahul Registrar0055h00000BBU9WSouth AfricaLiberal ArtsB.Sc2041Actual Core Q43
146J.laxmi0051e000005GtrDIndiaEngineeringB.A2042Target Core Q16
147J.laxmi0051e000005GtrDIndiaEngineeringB.A2042Target Core Q29
148J.laxmi0051e000005GtrDIndiaEngineeringB.A2042Target Core Q36
149J.laxmi0051e000005GtrDIndiaEngineeringB.A2042Target Core Q46
150J.laxmi0051e000005GtrDIndiaEngineeringB.A2042Actual Core Q11
151J.laxmi0051e000005GtrDIndiaEngineeringB.A2042Actual Core Q23
152J.laxmi0051e000005GtrDIndiaEngineeringB.A2042Actual Core Q34
153J.laxmi0051e000005GtrDIndiaEngineeringB.A2042Actual Core Q41
154srivatsan N0051e000005RVY4South AfricaManagementM.sc2043Target Core Q18
155srivatsan N0051e000005RVY4South AfricaManagementM.sc2043Target Core Q28
156srivatsan N0051e000005RVY4South AfricaManagementM.sc2043Target Core Q38
157srivatsan N0051e000005RVY4South AfricaManagementM.sc2043Target Core Q48
158srivatsan N0051e000005RVY4South AfricaManagementM.sc2043Actual Core Q12
159srivatsan N0051e000005RVY4South AfricaManagementM.sc2043Actual Core Q24
160srivatsan N0051e000005RVY4South AfricaManagementM.sc2043Actual Core Q33
161srivatsan N0051e000005RVY4South AfricaManagementM.sc2043Actual Core Q42
162Ishu M0051e000005S5wCIndiaManagementB.Com2044Target Core Q19
163Ishu M0051e000005S5wCIndiaManagementB.Com2044Target Core Q26
164Ishu M0051e000005S5wCIndiaManagementB.Com2044Target Core Q39
165Ishu M0051e000005S5wCIndiaManagementB.Com2044Target Core Q49
166Ishu M0051e000005S5wCIndiaManagementB.Com2044Actual Core Q13
167Ishu M0051e000005S5wCIndiaManagementB.Com2044Actual Core Q25
168Ishu M0051e000005S5wCIndiaManagementB.Com2044Actual Core Q34
169Ishu M0051e000005S5wCIndiaManagementB.Com2044Actual Core Q43
170Praba k0051e000005Ga3iSouth AfricaLiberal ArtsBBA2045Target Core Q17
171Praba k0051e000005Ga3iSouth AfricaLiberal ArtsBBA2045Target Core Q28
172Praba k0051e000005Ga3iSouth AfricaLiberal ArtsBBA2045Target Core Q37
173Praba k0051e000005Ga3iSouth AfricaLiberal ArtsBBA2045Target Core Q47
174Praba k0051e000005Ga3iSouth AfricaLiberal ArtsBBA2045Actual Core Q14
175Praba k0051e000005Ga3iSouth AfricaLiberal ArtsBBA2045Actual Core Q25
176Praba k0051e000005Ga3iSouth AfricaLiberal ArtsBBA2045Actual Core Q35
177Praba k0051e000005Ga3iSouth AfricaLiberal ArtsBBA2045Actual Core Q44
178Anandh N0051e000005QwvhIndiaEngineeringMBA2046Target Core Q16
179Anandh N0051e000005QwvhIndiaEngineeringMBA2046Target Core Q29
180Anandh N0051e000005QwvhIndiaEngineeringMBA2046Target Core Q36
181Anandh N0051e000005QwvhIndiaEngineeringMBA2046Target Core Q46
182Anandh N0051e000005QwvhIndiaEngineeringMBA2046Actual Core Q15
183Anandh N0051e000005QwvhIndiaEngineeringMBA2046Actual Core Q24
184Anandh N0051e000005QwvhIndiaEngineeringMBA2046Actual Core Q36
185Anandh N0051e000005QwvhIndiaEngineeringMBA2046Actual Core Q45
186Dia A0051e000005Sl8iSouth AfricaManagementBtech2047Target Core Q18
187Dia A0051e000005Sl8iSouth AfricaManagementBtech2047Target Core Q27
188Dia A0051e000005Sl8iSouth AfricaManagementBtech2047Target Core Q38
189Dia A0051e000005Sl8iSouth AfricaManagementBtech2047Target Core Q48
190Dia A0051e000005Sl8iSouth AfricaManagementBtech2047Actual Core Q15
191Dia A0051e000005Sl8iSouth AfricaManagementBtech2047Actual Core Q23
192Dia A0051e000005Sl8iSouth AfricaManagementBtech2047Actual Core Q35
193Dia A0051e000005Sl8iSouth AfricaManagementBtech2047Actual Core Q45
194kishorkumartest P0051e000005UKX1IndiaLiberal ArtsMtech2048Target Core Q19
195kishorkumartest P0051e000005UKX1IndiaLiberal ArtsMtech2048Target Core Q26
196kishorkumartest P0051e000005UKX1IndiaLiberal ArtsMtech2048Target Core Q39
197kishorkumartest P0051e000005UKX1IndiaLiberal ArtsMtech2048Target Core Q49
198kishorkumartest P0051e000005UKX1IndiaLiberal ArtsMtech2048Actual Core Q14
199kishorkumartest P0051e000005UKX1IndiaLiberal ArtsMtech2048Actual Core Q22
200kishorkumartest P0051e000005UKX1IndiaLiberal ArtsMtech2048Actual Core Q31
201kishorkumartest P0051e000005UKX1IndiaLiberal ArtsMtech2048Actual Core Q44
202tony chris0051e000005UFP7South AfricaEngineeringB.Sc2049Target Core Q19
203tony chris0051e000005UFP7South AfricaEngineeringB.Sc2049Target Core Q28
204tony chris0051e000005UFP7South AfricaEngineeringB.Sc2049Target Core Q39
205tony chris0051e000005UFP7South AfricaEngineeringB.Sc2049Target Core Q49
206tony chris0051e000005UFP7South AfricaEngineeringB.Sc2049Actual Core Q13
207tony chris0051e000005UFP7South AfricaEngineeringB.Sc2049Actual Core Q23
208tony chris0051e000005UFP7South AfricaEngineeringB.Sc2049Actual Core Q32
209tony chris0051e000005UFP7South AfricaEngineeringB.Sc2049Actual Core Q43
210Rahul Registrar0055h00000BBU9WIndiaManagementB.A2050Target Core Q18
211Rahul Registrar0055h00000BBU9WIndiaManagementB.A2050Target Core Q27
212Rahul Registrar0055h00000BBU9WIndiaManagementB.A2050Target Core Q38
213Rahul Registrar0055h00000BBU9WIndiaManagementB.A2050Target Core Q48
214Rahul Registrar0055h00000BBU9WIndiaManagementB.A2050Actual Core Q12
215Rahul Registrar0055h00000BBU9WIndiaManagementB.A2050Actual Core Q21
216Rahul Registrar0055h00000BBU9WIndiaManagementB.A2050Actual Core Q33
217Rahul Registrar0055h00000BBU9WIndiaManagementB.A2050Actual Core Q42
Table1



Desired Data Format

Ashish-Dipika Data.xlsx
ABCDEFGHIJ
32Regional ManagerRegional Manager idCountrySchoolDivisionPlacement Cycle-YearTarget QValueActual QValue
33J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Target Core Q18Actual Core Q11
34J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Target Core Q29Actual Core Q22
35J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Target Core Q38Actual Core Q35
36J.laxmi0051e000005GtrDUnited KingdomManagementBtech2024Target Core Q48Actual Core Q41
Sheet1
 
Last edited by a moderator:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Assuming your table name is Table1... how about:

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Regional Manager", type text}, {"Regional Manager id", type text}, {"Country", type text}, {"School", type text}, {"Division", type text}, {"Placement Cycle-Year", Int64.Type}, {"Target Core Q1", Int64.Type}, {"Target Core Q2", Int64.Type}, {"Target Core Q3", Int64.Type}, {"Target Core Q4", Int64.Type}, {"Actual Core Q1", Int64.Type}, {"Actual Core Q2", Int64.Type}, {"Actual Core Q3", Int64.Type}, {"Actual Core Q4", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Regional Manager", "Regional Manager id", "Country", "School", "Division", "Placement Cycle-Year"}, "Attribute", "Value"),
    #"Duplicated Column" = Table.DuplicateColumn(#"Unpivoted Columns", "Attribute", "Attribute - Copy"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Duplicated Column", "Attribute - Copy", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"Attribute - Copy.1", "Attribute - Copy.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Attribute - Copy.1", type text}, {"Attribute - Copy.2", type text}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Attribute - Copy.2"}),
    #"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[#"Attribute - Copy.1"]), "Attribute - Copy.1", "Value", List.Sum),
    MainTable = Table.Sort(#"Pivoted Column",{{"Attribute", Order.Ascending}}),
    #"Filtered Rows" = Table.SelectRows(MainTable, each ([Target Core] <> null)),
    #"Removed Columns1" = Table.RemoveColumns(#"Filtered Rows",{"Actual Core"}),
    #"Sorted Rows" = Table.Sort(#"Removed Columns1",{{"Regional Manager", Order.Ascending}, {"Regional Manager id", Order.Ascending}, {"Country", Order.Ascending}, {"School", Order.Ascending}, {"Division", Order.Ascending}, {"Placement Cycle-Year", Order.Ascending}, {"Attribute", Order.Ascending}}),
    TargetCore = Table.AddIndexColumn(#"Sorted Rows", "Index", 0, 1, Int64.Type),
    Custom1 = MainTable,
    #"Filtered Rows1" = Table.SelectRows(Custom1, each ([Actual Core] <> null)),
    #"Removed Columns2" = Table.RemoveColumns(#"Filtered Rows1",{"Target Core"}),
    #"Sorted Rows1" = Table.Sort(#"Removed Columns2",{{"Regional Manager", Order.Ascending}, {"Regional Manager id", Order.Ascending}, {"Country", Order.Ascending}, {"School", Order.Ascending}, {"Division", Order.Ascending}, {"Placement Cycle-Year", Order.Ascending}, {"Attribute", Order.Ascending}}),
    ActualCore = Table.AddIndexColumn(#"Sorted Rows1", "Index", 0, 1, Int64.Type),
    #"Merged Queries" = Table.NestedJoin(ActualCore, {"Index"}, TargetCore, {"Index"}, "Table1", JoinKind.LeftOuter),
    #"Expanded Table1" = Table.ExpandTableColumn(#"Merged Queries", "Table1", {"Target Core"}, {"Table1.Target Core"}),
    #"Duplicated Column1" = Table.DuplicateColumn(#"Expanded Table1", "Attribute", "Attribute - Copy"),
    #"Replaced Value" = Table.ReplaceValue(#"Duplicated Column1","Actual","Target",Replacer.ReplaceText,{"Attribute - Copy"}),
    #"Renamed Columns" = Table.RenameColumns(#"Replaced Value",{{"Attribute - Copy", "Target Q"}, {"Table1.Target Core", "Target Value"}, {"Attribute", "Actual Q"}, {"Actual Core", "Actual Value"}}),
    #"Removed Columns3" = Table.RemoveColumns(#"Renamed Columns",{"Index"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns3",{"Regional Manager", "Regional Manager id", "Country", "School", "Division", "Placement Cycle-Year", "Target Q", "Target Value", "Actual Q", "Actual Value"}),
    #"Filtered Rows2" = Table.SelectRows(#"Reordered Columns", each ([Regional Manager] = "J.laxmi") and ([Country] = "United Kingdom"))
in
    #"Filtered Rows2"
 
Upvote 0
Like this ?

Power Query:
let
    fx = (x,y,z)=> Record.SelectFields(x,List.Select(y, (w)=> Text.Contains(w,z))),
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    ColName = {List.Select(Table.ColumnNames(Source), (x) => not Text.Contains(x,"Core"))} & {{"Target Q", "Value", "Actual Q", "Value2"}},
    Process = Table.AddColumn(Source, "x", each let x =fx(_,Table.ColumnNames(Source),"Core") in  
              Table.FromColumns(Table.ToColumns(Record.ToTable(fx(x,Record.FieldNames(x) ,"Target"))) &
              Table.ToColumns(Record.ToTable(fx(x,Record.FieldNames(x) ,"Actual"))), ColName{1})),
    Result = Table.SelectColumns(Table.ExpandTableColumn(Process, "x", ColName{1}, ColName{1}), List.Union(ColName))
in
    Result
 
Upvote 1
Solution
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    cols = {"Regional Manager", "Regional Manager id", "Country", "School", "Division", "Placement Cycle-Year"},
    unpivot = Table.UnpivotOtherColumns(Source, cols, "Attribute", "Value"),
    addQTR = Table.AddColumn(unpivot, "Qtr", each Number.From(Text.End([Attribute],1))),
    removeQ = Table.TransformColumns(addQTR, {{"Attribute", each Text.BeforeDelimiter(_, " ", 1), type text}}),
    group = Table.Group(removeQ, cols & {"Qtr"}, {{"All", each Table.Pivot(_, {"Target Core", "Actual Core"}, "Attribute", "Value")}}),
    combine = Table.Combine(group[All])
in
    combine
 
Upvote 1
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    cols = Table.ColumnNames(Source),
    target = List.Buffer(List.Range(cols, 6, 4)), 
    actual = List.Buffer(List.Range(cols, 10, 4)),
    to_list = Table.ToList(
        Source, 
        (w) => List.TransformMany(
            {w}, 
            (x) => List.Zip({target, List.Range(x, 6, 4), actual, List.Range(x, 10, 4)}),
            (x, y) => List.FirstN(x, 6) & y
        )
    ), 
    to_table = Table.FromList(
        List.Combine(to_list), 
        (x) => x, 
        List.FirstN(cols, 6) & {"Target Q", "Target Value", "Actual Q", "Actual Value"}
    )
in
    to_table
 
Upvote 0
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    cols = {"Regional Manager", "Regional Manager id", "Country", "School", "Division", "Placement Cycle-Year"},
    unpivot = Table.UnpivotOtherColumns(Source, cols, "Attribute", "Value"),
    addQTR = Table.AddColumn(unpivot, "Qtr", each Number.From(Text.End([Attribute],1))),
    removeQ = Table.TransformColumns(addQTR, {{"Attribute", each Text.BeforeDelimiter(_, " ", 1), type text}}),
    group = Table.Group(removeQ, cols & {"Qtr"}, {{"All", each Table.Pivot(_, {"Target Core", "Actual Core"}, "Attribute", "Value")}}),
    combine = Table.Combine(group[All])
in
    combine
Dear @JGordon11 ,

Thanks for your solution. What @alex78 gave was the solution I was looking for but what you gave was solution of my next step which I had planned so Thank you for guiding me in advance.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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