Forum Discussion
Unpivoting Multi Columns based on specific text contain in Header (Date)
First 2 columns are parts of fact table, so does not require any transformation.
But for all dates and amount, need to unpivot which will be in column3 and column4.
Output should be something similar to below table.
Thanks in advance.
- wdx223_Daniel3 years agoCommunity Champion
NewStep=Table.Combine(Table.TransformRows(Table1,each let a=Record.ToTable(_) in Table.Combine(Table.Group(Table.Skip(a,2),"Name",{"n",each #table(List.FirstN(a[Name],2)&List.TransformMany({1..Table.RowCount(_)},each {"Attribute","Value"},(x,y)=>y&Text.From(x)),{List.FirstN(a[Value],2)&List.Combine(Table.ToRows(_))})},0,(x,y)=>Byte.From(Text.EndsWith(y,"Date")))[n]))
- PEEVEE3 years agoRegular Visitor
this code is not working in my current PBI Power Query, if you have created any sample data for my subjected problem, request you to please share PBIX sample file for my better understaning on code & its working.