Forum Discussion
Anonymous
1 year agoNot applicable
Adding new column based on row and column?
Hi all, I'm trying to add a new custom column based on specific values in my table. Data is text file with breaks that gets imported into Power Query as follows: Trying to format ...
- 1 year ago
Hi Anonymous
let
Source = Your_Source,
Columns = List.Transform(List.FirstN(Source[DATA], 5), each Text.BetweenDelimiters(_, "!", "=")),
Group = Table.Group(Source, {"DATA"},
{{"data", (x) =>
{Table.RemoveFirstN(x, 5)} &
{#table(Columns, {List.FirstN(x[DATA], 5)})} }},
GroupKind.Local,
(x,y)=>Byte.From(Text.StartsWith(y[DATA],"!Cat"))),
Combine = Table.FromRows(Group[data], {"Table1", "Table2"}),
Expand = Table.ExpandTableColumn(Combine, "Table2", Columns, Columns),
Result = Table.ExpandTableColumn(Expand, "Table1", {"DATA", "Column1"}, {"DATA", "Column1"})
in
ResultStéphane
v-veshwara-msft
1 year agoCommunity Support
Hi Anonymous ,
Thank you for engaging with the Fabric Community.
And thanks to everyone who contributed. Your input is truly valued.
Anonymous , were you able to resolve your query? If so, kindly mark the helpful response as "Accepted Solution" to assist others who may have the similar question. If a different solution worked, please share it here and mark it as "Accepted Solution" to benefit the community.
If you still need help, feel free to let us know.
Thank you.