Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Deleting/Removing specific rows in Power BI Query

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.

Gutschrift.Credit.PNG


I want everything delet in Action(Maßnahme) Credit(Gutschrift) which has not these numbers:

DEMS.PNG


The big problem is that I only want to affect a part of a column and Query not the entire thing...

 

 

2 ACCEPTED SOLUTIONS
Jimmy801
Community Champion
Community Champion

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

View solution in original post

Icey
Community Support
Community Support

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.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

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.

Jimmy801
Community Champion
Community Champion

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.