top of page

Excel Arena

This is the place, where we can test the boundaries of Excel functions.

Set a Single Value as the Row Header for every row - Power Query

The source data has the Organization Name in the first row, followed by Product and Version details in the subsequent rows.

ree

The goal is to convert this into a three-column table, with each column representing Organization, Product, and Version information.

In this post, I will showcase two different methods to achieve this.


Method-1:


let

 Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],

 Result = Table.FromRows(List.Transform(List.Split(List.Skip(Source[Data]),2), (f) => {Table.FirstValue(Source)} & f),{"Org","Product","Version"} )

in

 Result


Method-2:


let

 Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],

 Result = Table.FillDown(Table.FromColumns({{Table.FirstValue(Source)}} & List.Zip(List.Split(List.Skip(Source[Data]),2)),{"Org","Product","Version"}),{"Org"})

in

 Result

Recent Posts

See All
Recursion in Excel and Power Query

In this post, I will demonstrate recursion in Excel and Power Query with some basic examples. Example 1: You are on a set of stairs that...

 
 
 

Comments


  • Facebook
  • Twitter
  • LinkedIn

©2022 by Excel with Excel. Proudly created with Wix.com

bottom of page