Unpivot - Help Required

sedu1110

New Member
Joined
Nov 24, 2019
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
Hi ,

I am very new to power query . I have a raw set of data . In excel I use a three way look up to get the required answer. The attached input file and the related output file after using formula will give you an idea of what I do. Since my actual data set is very large, the formulas take a very long time to process.

I also need to make this report twice a week. I would require help on doing the same in Power query.

I have tried using Unpivot . But I believe I am doing something wrong as I do not get my intended results.
I request guidance on how can I do the same in Power Query.
 

Attachments

  • Inputs.png
    Inputs.png
    195.3 KB · Views: 23
  • Ouput.png
    Ouput.png
    35.1 KB · Views: 22

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
This seems to do the trick.

VBA Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table6"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"Candidate ID", Int64.Type}, {"Name", type text}, {"Stage", type text}, {"Stage ID", type date}}),
    Pivot = Table.Pivot(Type, List.Distinct(Type[Stage]), "Stage", "Stage ID")
in
    Pivot
 
Upvote 0
This seems to do the trick.

VBA Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table6"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"Candidate ID", Int64.Type}, {"Name", type text}, {"Stage", type text}, {"Stage ID", type date}}),
    Pivot = Table.Pivot(Type, List.Distinct(Type[Stage]), "Stage", "Stage ID")
in
    Pivot

The code you provided is truly beneficial for me.
Thank you for your support.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
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