Forum Discussion
Unpivot multile columns
- 5 years ago
Hello ITManuel
for sure you have to integrate my query in yours, but you have also to replace my datasource with your existing query. I can not test your query, but i try to fix it.
let Source = Excel.Workbook(File.Contents("C:\Users\Manuelm\Desktop\Project reporting\GPC\GPC -- Invoices and Payments.xlsx"), null, true), GPCInvPayStatus_Table = Source{[Item="GPCInvPayStatus",Kind="Table"]}[Data], #"Removed Columns" = Table.RemoveColumns(GPCInvPayStatus_Table,{".", "Fälligkeit", "Zahlung", "Fäl.", "Zahl.Art", "Zahlungsart"}) ProjectColumns = List.Select(Table.ColumnNames(#"Removed Columns"), each not Text.Contains(_, "amount")), AmountColumns = List.Select(Table.ColumnNames(#"Removed Columns"), each Text.Contains(_, "amount")), GetProjectColumns = List.Combine(List.Transform(ProjectColumns, each Table.Column(#"Removed Columns", _))), GetAmountColumns = List.Combine(List.Transform(AmountColumns, each Table.Column(#"Removed Columns", _))), CreateFinalTable = Table.FromColumns({GetProjectColumns,GetAmountColumns }, {"Project", "Project amount"}) in CreateFinalTable
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hi ITManuel
Your query is unclear, can you please share the pbix file or data in excel and also share the expected output you want to achieve.
Refer to article below, to get your queries answered in timely manner.
Thanks,
Ankit
Hi AnkitKukreja ,
sorry for not beeing clear.
I have the data and the pbix file under the following link. https://we.tl/t-RSobOxH3aR
Basically I have a table which contains invoices, their related total amount and the portions of these invoices for multiple projects.
P1 - P7 & Not assigned to any project.
For these P1 - P7 & Not assigned the table has 16 colums, 2 for each project or not assigned.
I would like to have 2 columns out of these 16, 1 for Project ID (P1, P2.....) and one for the related values.
Best regards