• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Create Table With Dynamic Heading

Cheloo

New Member
Happy New Year to all the experts!

Please, I have a question. I want to merge various tables in different worksheets with headings corresponding to dates, but every time I change the date, my query fails. I need help. Thank you, and please find my spreadsheet attached. The idea here is to figure out how to make a query that will allow me to change the heading titles.

Thank you
 

Attachments

  • Challenge Heading powerquery.xlsx
    20.1 KB · Views: 4
Alternative is to unpivot first and load as a pivot table again.


Code:
let
    Source = List.Transform(
                Excel.CurrentWorkbook()[Content],
                each Table.UnpivotOtherColumns(_, {"Client"}, "Date", "Value")
            ),
    Append = Table.Combine(Source),
    Set_Types = Table.TransformColumnTypes(Append,
                {
                    {"Date", type date},
                    {"Value", type number},
                    {"Client", type text}
                }
            )
in
    Set_Types
 

Attachments

  • Challenge Heading powerquery.xlsx
    28.3 KB · Views: 2
Back
Top