Hello good afternoon, how could I adapt this table with Power Query?
Thank you
Hello good afternoon, how could I adapt this table with Power Query?
Thank you
See the attached file in which each date column and data are considered separate tables. Once in PQ, each is grouped and totaled. Merged on dates. Then accumulated horizontally. Not necessarily pretty, but works. FYI. The sums do not match your sums. I am not sure where yours came from.
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
Power Query(.planetaexcel.ru)
sotnikov
![]()
let from = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], lst = List.Combine(Table.ToList(from,(x)=>List.Split(x,3))), tbl = Table.FromList(List.Select(lst,(x)=>x{0}<>null),(x)=>x), to = Table.Group(tbl,"Column1",{"Column2",each List.Sum([Column2])}), #"Changed Type" = Table.TransformColumnTypes(to,{{"Column1", type date}}) in #"Changed Type"
AlienSx![]()
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], cols = Table.ToColumns(Source), dates = List.Combine(List.Alternate(cols, 2, 1, 1)), amounts = List.Combine(List.Alternate(List.Skip(cols), 2, 1, 1)), tbl = #table({"date", "amount"}, List.Zip({dates, amounts})), gr = Table.Group(tbl, "date", {"amount", (x) => List.Sum(x[amount])}), filter = Table.SelectRows(gr, each ([date] <> null)), #"Changed Type" = Table.TransformColumnTypes(filter,{{"date", type date}}) in #"Changed Type"
What does planetexcel.ru have to do with this? And sotnikov? AlienSX?![]()
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
My option PQ![]()
let Source = Excel.Workbook(File.Contents("C:\Users\seven\Documents\Documents\Pasta2(11).xlsx"), null, true), #"Filtered Rows" = Table.SelectRows(Source, each ([Kind] = "Table") and ([Name] <> "Table2_2")), #"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"Name", Order.Ascending}}), #"Expanded Data" = Table.ExpandTableColumn(#"Sorted Rows", "Data", {"Column1", "Column2"}, {"Column1", "Column2"}), #"Removed Other Columns" = Table.SelectColumns(#"Expanded Data",{"Column1", "Column2"}), #"Filtered Rows1" = Table.SelectRows(#"Removed Other Columns", each ([Column1] <> "Banco A" and [Column1] <> "Banco B" and [Column1] <> "Banco C" and [Column1] <> "Banco D")), #"Grouped Rows" = Table.Group(#"Filtered Rows1", {"Column1"}, {{"Count", each List.Sum([Column2]), type number}}), #"Sorted Rows1" = Table.Sort(#"Grouped Rows",{{"Column1", Order.Ascending}}) in #"Sorted Rows1"
I asked a question about post #3 - what is your answer, ple\se? Thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks