Forum Discussion
How to convert data (add date in columns)
Hi,
please help me convert the data,
in the columns are months in totals and the names of people for each month (without the month in the column name), as in the screenshot
thanks a lot!
NewStep=Table.FromRecords(List.TransfromMany(Table.ToRecords(YourOriginalTable),each List.Combine(List.Skip(Table.Group(Record.ToTable(_),"Name",{"n",each Table.ToRecords(Table.AddColumn(Table.Skip(_),"Month",(x)=>[Name]{0}))},0,(x,y)=>Byte.From(Text.StartsWith(y,"2023M")))[n])),(x,y)=>x[[account],[note]]&y))
4 Replies
- wdx223_DanielCommunity Champion
NewStep=Table.FromRecords(List.TransfromMany(Table.ToRecords(YourOriginalTable),each List.Combine(List.Skip(Table.Group(Record.ToTable(_),"Name",{"n",each Table.ToRecords(Table.AddColumn(Table.Skip(_),"Month",(x)=>[Nam]{0}))},0,(x,y)=>Byte.From(Text.StartsWith(y,"2023M")))[n])) in x[[account],[note]]&y))
- misio1023New Member
thanks, but i get error:
thanks!
- wdx223_DanielCommunity Champion
NewStep=Table.FromRecords(List.TransfromMany(Table.ToRecords(YourOriginalTable),each List.Combine(List.Skip(Table.Group(Record.ToTable(_),"Name",{"n",each Table.ToRecords(Table.AddColumn(Table.Skip(_),"Month",(x)=>[Name]{0}))},0,(x,y)=>Byte.From(Text.StartsWith(y,"2023M")))[n])),(x,y)=>x[[account],[note]]&y))