Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hi -
I know in Power Query you can "Use First Row as headers" function.
Is there a way to use the first two rows as headers (combine both rows to create one header row).
Example:
| a | b | c | d |
| e | f | g | h |
| 10 | 20 | 30 | 40 |
| 50 | 60 | 70 | 80 |
| 90 | 100 | 110 | 120 |
Output:
| ae | bf | cg | dh |
| 10 | 20 | 30 | 40 |
| 50 | 60 | 70 | 80 |
| 90 | 100 | 110 | 120 |
Any thoughts?
Thanks - jerryr
Solved! Go to Solution.
Here's another solution you could refer to. Thanks
Here's another solution you could refer to. Thanks
Thank you very much
Hi @jerryr125, another solution:
Add this code as a new step, replace Source in code with your previous_step_name if necessary.
= Table.PromoteHeaders(Table.FromColumns(List.TransformMany(Table.ToColumns(Source),
each {List.Skip(_, 2)},
(x,y)=> {Text.Combine(List.FirstN(x, 2))} & y)))
Hi @jerryr125
= Table.FromRows(
List.Skip(Table.ToRows(Source), 2),
List.Transform(
List.Zip({Record.ToList(Source{0}), Record.ToList(Source{1})}),
Text.Combine))
Stéphane
@jerryr125
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes give below and follow the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("JYu5DcBADMN2UX2FnT+zGC7yZ/8JIjkFCUKAIrChYScHOZEtcLFu8pC3FjdmJ/XSYLWO6kmapeVfV7VbuX7OY+YH", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t]),
Custom1 = Table.FromRows({List.Transform(Table.ToColumns(Table.FirstN(Source,2)) , each Text.Combine(_) )}),
Custom2 = Table.PromoteHeaders(Table.Combine( {Custom1 , Table.Skip(Source,2)} ))
in
Custom2
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @jerryr125 , Could you please try this
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 5 | |
| 4 | |
| 4 |