Forum Discussion
Combine/Merge multiple columns based on its name
- 7 years ago
Hi PBIDevNoob
In Edit queries, add an index column, click on the "index column", then select "unpivot other columns".
Add column->Extact->"Text After Delimiter"/"Text Before Delimiter"
#"Inserted Text After Delimiter" = Table.AddColumn(#"Unpivoted Other Columns", "Text After Delimiter", each Text.AfterDelimiter([Attribute], "_"), type text), #"Inserted Text Before Delimiter" = Table.AddColumn(#"Inserted Text After Delimiter", "Text Before Delimiter", each Text.BeforeDelimiter([Attribute], "-"), type text),
Add column->Merge columns
Remove useless columns
To make the "start date" and "end date" as columns name, click on the column, select "pivot columns"
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi PBIDevNoob
In Edit queries, add an index column, click on the "index column", then select "unpivot other columns".
Add column->Extact->"Text After Delimiter"/"Text Before Delimiter"
#"Inserted Text After Delimiter" = Table.AddColumn(#"Unpivoted Other Columns", "Text After Delimiter", each Text.AfterDelimiter([Attribute], "_"), type text), #"Inserted Text Before Delimiter" = Table.AddColumn(#"Inserted Text After Delimiter", "Text Before Delimiter", each Text.BeforeDelimiter([Attribute], "-"), type text),
Add column->Merge columns
Remove useless columns
To make the "start date" and "end date" as columns name, click on the column, select "pivot columns"
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.