The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Power BI Team,
I need your help!
I got a column with actions like refurbisment, Load and Credit(Gutschrift).
The action Credit shows wrong and unneeded data. I want to delete the wrong rows but How can I do this with only the PB Option delet first and last rows...
I also need the other actions. I can not just only select Credit.
I want everything delet in Action(Maßnahme) Credit(Gutschrift) which has not these numbers:
The big problem is that I only want to affect a part of a column and Query not the entire thing...
Solved! Go to Solution.
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
SelectYourRows
Copy 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
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.
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
SelectYourRows
Copy 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