Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
manoplaeli
Helper II
Helper II

Fill up only top row

Screenshot_3.png

I have a heading shift as in the picture. I want to aligh them to the same row so I can promote it as heading column. I try filldown but doesn't work because I only want to fill down 1 row. Then I try fill up. it is also filled from the bottom where where is null. How could I re-aligh this heading to the same row.

 

Thanks,

1 ACCEPTED SOLUTION

let
    Source = Excel.Workbook(Web.Contents("https://xxxxxx.xlsx"), null, true),
    #"Partner Advance Liquidatio_Sheet" = Source{[Item="Partner Advance Liquidatio",Kind="Sheet"]}[Data],
    #"Changed Type" = Table.TransformColumnTypes(#"Partner Advance Liquidatio_Sheet",{{"Column1", type any}, {"Column2", type text}, {"Column3", type text}, {"Column4", type any}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type any}, {"Column11", type text}, {"Column12", Int64.Type}, {"Column13", Int64.Type}, {"Column14", Int64.Type}, {"Column15", Int64.Type}, {"Column16", Int64.Type}, {"Column17", Int64.Type}, {"Column18", Int64.Type}, {"Column19", Int64.Type}, {"Column20", Int64.Type}, {"Column21", Int64.Type}, {"Column22", Int64.Type}, {"Column23", Int64.Type}, {"Column24", Int64.Type}, {"Column25", Int64.Type}, {"Column26", Int64.Type}, {"Column27", Int64.Type}, {"Column28", Int64.Type}, {"Column29", Int64.Type}, {"Column30", Int64.Type}, {"Column31", Int64.Type}, {"Column32", type any}, {"Column33", type text}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",6),
    NewStep=let a=Table.ToRows(#"Removed Top Rows") in Table.PromoteHeaders(Table.FromRows({List.Transform(List.Zip(List.FirstN(a,2)),each Text.Format("#{0}#{1}",_))}&List.Skip(a,2)))
in
    NewStep

View solution in original post

7 REPLIES 7
manoplaeli
Helper II
Helper II

Could you add the code inside. I am not sure where I need to change.

let
    Source = Excel.Workbook(Web.Contents("https://xxxxxx.xlsx"), null, true),
    #"Partner Advance Liquidatio_Sheet" = Source{[Item="Partner Advance Liquidatio",Kind="Sheet"]}[Data],
    #"Changed Type" = Table.TransformColumnTypes(#"Partner Advance Liquidatio_Sheet",{{"Column1", type any}, {"Column2", type text}, {"Column3", type text}, {"Column4", type any}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type any}, {"Column11", type text}, {"Column12", Int64.Type}, {"Column13", Int64.Type}, {"Column14", Int64.Type}, {"Column15", Int64.Type}, {"Column16", Int64.Type}, {"Column17", Int64.Type}, {"Column18", Int64.Type}, {"Column19", Int64.Type}, {"Column20", Int64.Type}, {"Column21", Int64.Type}, {"Column22", Int64.Type}, {"Column23", Int64.Type}, {"Column24", Int64.Type}, {"Column25", Int64.Type}, {"Column26", Int64.Type}, {"Column27", Int64.Type}, {"Column28", Int64.Type}, {"Column29", Int64.Type}, {"Column30", Int64.Type}, {"Column31", Int64.Type}, {"Column32", type any}, {"Column33", type text}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",6)
in
    #"Removed Top Rows"

let
    Source = Excel.Workbook(Web.Contents("https://xxxxxx.xlsx"), null, true),
    #"Partner Advance Liquidatio_Sheet" = Source{[Item="Partner Advance Liquidatio",Kind="Sheet"]}[Data],
    #"Changed Type" = Table.TransformColumnTypes(#"Partner Advance Liquidatio_Sheet",{{"Column1", type any}, {"Column2", type text}, {"Column3", type text}, {"Column4", type any}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type any}, {"Column11", type text}, {"Column12", Int64.Type}, {"Column13", Int64.Type}, {"Column14", Int64.Type}, {"Column15", Int64.Type}, {"Column16", Int64.Type}, {"Column17", Int64.Type}, {"Column18", Int64.Type}, {"Column19", Int64.Type}, {"Column20", Int64.Type}, {"Column21", Int64.Type}, {"Column22", Int64.Type}, {"Column23", Int64.Type}, {"Column24", Int64.Type}, {"Column25", Int64.Type}, {"Column26", Int64.Type}, {"Column27", Int64.Type}, {"Column28", Int64.Type}, {"Column29", Int64.Type}, {"Column30", Int64.Type}, {"Column31", Int64.Type}, {"Column32", type any}, {"Column33", type text}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",6),
    NewStep=let a=Table.ToRows(#"Removed Top Rows") in #table(List.Transform(List.Zip(List.FirstN(a,2)),each Text.Format("#{0}#{1}",_)),List.Skip(a,2))
in
    NewStep

it give me an error.

Screenshot_4.png

I share the Power BI file example. What I want is the promote the below in red box to be column header. Here is the link to pbix file

Screenshot_5.png

 

at least you have two columns that both value in the first two rows are null

So how could I fix it?

let
    Source = Excel.Workbook(Web.Contents("https://xxxxxx.xlsx"), null, true),
    #"Partner Advance Liquidatio_Sheet" = Source{[Item="Partner Advance Liquidatio",Kind="Sheet"]}[Data],
    #"Changed Type" = Table.TransformColumnTypes(#"Partner Advance Liquidatio_Sheet",{{"Column1", type any}, {"Column2", type text}, {"Column3", type text}, {"Column4", type any}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type any}, {"Column11", type text}, {"Column12", Int64.Type}, {"Column13", Int64.Type}, {"Column14", Int64.Type}, {"Column15", Int64.Type}, {"Column16", Int64.Type}, {"Column17", Int64.Type}, {"Column18", Int64.Type}, {"Column19", Int64.Type}, {"Column20", Int64.Type}, {"Column21", Int64.Type}, {"Column22", Int64.Type}, {"Column23", Int64.Type}, {"Column24", Int64.Type}, {"Column25", Int64.Type}, {"Column26", Int64.Type}, {"Column27", Int64.Type}, {"Column28", Int64.Type}, {"Column29", Int64.Type}, {"Column30", Int64.Type}, {"Column31", Int64.Type}, {"Column32", type any}, {"Column33", type text}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",6),
    NewStep=let a=Table.ToRows(#"Removed Top Rows") in Table.PromoteHeaders(Table.FromRows({List.Transform(List.Zip(List.FirstN(a,2)),each Text.Format("#{0}#{1}",_))}&List.Skip(a,2)))
in
    NewStep
wdx223_Daniel
Super User
Super User

=let a=Table.ToRows(PreviousStepName) in #table(List.Transform(List.Zip(List.FirstN(a,2)),each Text.Format("#{0}#{1}",_)),List.Skip(a,2))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors