cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
gvlado
Advocate I
Advocate I

How to transform title of the data table to column

Hello
I am still learning and have a simple problem that I couldn't find the solution to.
At the top of the source table there is date i need to incorporate in the report - so how to do it with Power Query in Power BI and Excel

 
gvlado_0-1657821675545.png

Thanks in advance 
Greetings from Croatia

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@gvlado Check if this can helps.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckksSVXSUVKK1YlWMjIwtNA1MNQ1NISJuBWVZpYUA3nO+Tn5RWChxIKCHJCOotQUML8gpzQXyC3LzM9JLQGLJGekFhVVAsWScxKLQGKxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Removed Top Rows" = Table.Skip(Source,2),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
    GetValueFromCell = Source{1} [Column1],
    #"Added Custom" = Table.AddColumn(#"Promoted Headers", "NewColumnName", each GetValueFromCell)
in
    #"Added Custom"

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@gvlado Check if this can helps.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckksSVXSUVKK1YlWMjIwtNA1MNQ1NISJuBWVZpYUA3nO+Tn5RWChxIKCHJCOotQUML8gpzQXyC3LzM9JLQGLJGekFhVVAsWScxKLQGKxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Removed Top Rows" = Table.Skip(Source,2),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
    GetValueFromCell = Source{1} [Column1],
    #"Added Custom" = Table.AddColumn(#"Promoted Headers", "NewColumnName", each GetValueFromCell)
in
    #"Added Custom"

Thanks , Mohan1029 - it works
Thanks a lot.
I learned something more

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors