Forum Discussion
Deleting/Removing specific rows in Power BI Query
- 5 years ago
Hello Anonymous
to delete some rows you can use Table.SelectRows and filter them out. If you need to keep some of this deleted rows, you can use a list and add in the Table.SelectRows a List.Contains-function. Here a practical example how this could work for you
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUQosTczJLDm8pEQpVidaKQlDJBko4l5aUpycUZSZBhHCrg1NEdH68FsXCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Maßnahme = _t, IDS = _t]), ChangedType = Table.TransformColumnTypes(Source,{{"Maßnahme", type text}, {"IDS", type text}}), YourListWithNumbersToKeep = {"a","b","c"}, SelectYourRows = Table.SelectRows ( ChangedType, (row)=> not(row[IDS]="Gutschrift" and List.Contains(YourListWithNumbersToKeep, row[Maßnahme])) ) in SelectYourRowsCopy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy - 5 years ago
Hi Anonymous ,
Please check if these posts are helpful:
How do I delete specific rows from my query tables?
Removing Unnecessary Rows in Power Query.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Please check if these posts are helpful:
How do I delete specific rows from my query tables?
Removing Unnecessary Rows in Power Query.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.