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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Vidushi_Mangal
Regular Visitor

removing multiple rows with same data

HI all,

I want to delete all the rows which has ".." value in column name "Street_No". Can somebody help me to acheive this?

 

 

3 ACCEPTED SOLUTIONS

What is the difference between filter and delete? Power Query can't change the source data - you can change only the output.


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

ann_2024
Helper I
Helper I

Hi @Vidushi_Mangal 

 

You can remove it in the Power Query using an additional step

 

let
    Source = ...,
    #"Removed Rows" = Table.SelectRows(Source, each [Street_No] <> ".."))
in
    #"Removed Rows"

 

 

If this doesnt work for you, you have to remove the columns from the source itself.

 

Thanks.

View solution in original post

v-xinruzhu-msft
Community Support
Community Support

Hi,

Thanks for the solutions KhaledAbdrhman ,ann_2024,dufoq3  and jennratten offered, and i want to offer some more infotmation for user to refer to.

hello @Vidushi_Mangal , based on your description, you can create a blank query, and input the following code in advanced editor. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQy1gMCpVgdMBtMm5iagenEpGQ9iGQsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Street_No = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Street_No", type text}}),
    Custom1 = Table.TransformColumns(#"Changed Type",{"Street_No",each if Text.Contains(_,"..") then null else _}),
    #"Removed Blank Rows" = Table.SelectRows(Custom1, each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
in
    #"Removed Blank Rows"

And you can refer to the attachment.

 

 

Best Regards!

Yolo Zhu

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

6 REPLIES 6
v-xinruzhu-msft
Community Support
Community Support

Hi,

Thanks for the solutions KhaledAbdrhman ,ann_2024,dufoq3  and jennratten offered, and i want to offer some more infotmation for user to refer to.

hello @Vidushi_Mangal , based on your description, you can create a blank query, and input the following code in advanced editor. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQy1gMCpVgdMBtMm5iagenEpGQ9iGQsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Street_No = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Street_No", type text}}),
    Custom1 = Table.TransformColumns(#"Changed Type",{"Street_No",each if Text.Contains(_,"..") then null else _}),
    #"Removed Blank Rows" = Table.SelectRows(Custom1, each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
in
    #"Removed Blank Rows"

And you can refer to the attachment.

 

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

KhaledAbdrhman
New Member

Hi, 

Select your column in power query and try to sort it so that the rows that contain the specific word you want is above each other, then select delete rows and delete them now it should be easier, hope this helped you.

ann_2024
Helper I
Helper I

Hi @Vidushi_Mangal 

 

You can remove it in the Power Query using an additional step

 

let
    Source = ...,
    #"Removed Rows" = Table.SelectRows(Source, each [Street_No] <> ".."))
in
    #"Removed Rows"

 

 

If this doesnt work for you, you have to remove the columns from the source itself.

 

Thanks.

jennratten
Super User
Super User

Hello, select the column named "Streen_No", choose the filter button on the header.  Follow the prompts to select rows which do not contain "..".

 

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

Thanx for response

But this will only filter the table and will not remove the rows. I want to delete them permanently.

 

What is the difference between filter and delete? Power Query can't change the source data - you can change only the output.


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors