Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Unfortunately you really have a problem in that your initial data is missing a record ID... a third column to identify what rows a field belongs to once it's unpivoted. A person could try to rely on the order in the table, but you have these null values that will foul that up. Also, from a purist position, sets are inherently unordered and you should never rely that the order of records is in any way constant unless enforced by a sort on the available data. Commented Mar 14, 2019 at 19:25
  • Then Pivot Table, Power Query wouldn't be the tools for this task? Commented Mar 14, 2019 at 19:39
  • If you go in and add a third column that can be used to group the fields according to rows, then Power Query can easily do what you want. Otherwise, no. Commented Mar 14, 2019 at 22:00
  • I understand from you, have a 3rd column with the fields that I want to use as headers in output. Is like that? May you show me how to that in Power Query if I have that 3rd column please? Commented Mar 14, 2019 at 23:16
  • @Olly has shown you a programmatic way to add the '3rd column'. If you step through his solution, you see how the 'Record Number' is required for a pivot to work. Commented Mar 15, 2019 at 16:27