Forum Discussion
davidz106
4 years agoHelper III
Remove all columns after certain value
I want to remove all columns after the column that is named "Q3". How should I write this in M?
The number of columns before Q3 is dynamic.
Regrads,
Dave
Insert following statement where you can replace Source with previous step
= Table.RemoveColumns(Source,List.RemoveRange(Table.ColumnNames(Source),0,List.PositionOf(Table.ColumnNames(Source),"Q3")+1))
2 Replies
- Vijay_A_VermaMost Valuable Professional
Insert following statement where you can replace Source with previous step
= Table.RemoveColumns(Source,List.RemoveRange(Table.ColumnNames(Source),0,List.PositionOf(Table.ColumnNames(Source),"Q3")+1))- davidz106Helper III
Works lika a charm! Thank you!