Forum Discussion
TanzilHasan
1 year agoFrequent Visitor
Concat rows in PowerQuery
Hi Good people, I'm new to the Power BI world and I'm working and learning at the same time. I want to concatenate the first two rows while keeping the other columns intact. This is easy to do i...
- 1 year ago
Hi,
This M code works
let Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content], #"Added Custom" = Record.ToTable(Table.AddColumn(Source, "Custom", each _){0}), #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Name] <> "Custom")), #"Added Custom1" = Table.AddColumn(#"Filtered Rows", "Custom", each if Text.StartsWith([Name],"Q",Comparer.OrdinalIgnoreCase) then [Name]&" "&[Value] else [Name]), Custom1 = Table.FromRows(Table.ToRows(Table.Skip(Source,1)),#"Added Custom1"[Custom]) in Custom1Hope this helps.
TanzilHasan
1 year agoFrequent Visitor
Thank you so much, it works.
Ashish_Mathur
1 year agoSuper User
You are welcome.