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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Marango
Regular Visitor

DELETE DATA FROM A COLUMN IN POWER QUERY

Hello,

I would like to know if there is any way to delete some data I do not need on power query?

 

for example in this data base in the column Type I have "production/ dups/ samples" for my report I only need "production" so I will like to delete all the raws that says "dups and samples"  and to have in the date base only production.

 

POID CodeQuantityType
20305SN0647P02NG028425Production
20305SN0647P02NGC001210Production
20305SN0647P02NGC00225Dups
 AD2078M01MGC001S1Samples
20311AD1874D02MGC003S12Dups
 AD2078M01MGC001S1Samples
 AD2086M01MGC002S4Dups
 AD2086M01MGC002S1Dups
 AD2087M01MGC002S1Dups
 AD2087M01MGC002S1Dups
 AD2087M01MGC002S1Samples
20317AD2088M01MGC002S1Samples
20317AD2088M01MGC002S1Samples
 AD2089M01MGC001S1Samples
20317AD2090M01MGC001S1Samples
20317AD2090M01MGC001S1Samples
20301AD2026P01MGC001L12Production
20301AD2026P01MGC001L12Production
20301AD2026P01MGC001M15Production
20301AD2026P01MGC001M15Production
20301AD2026P01MGC001S10Production
20317AD2091M01MGC001S1Samples
20301AD2026P01MGC001XL10Production
20301AD2026P01MGC002L12Production
20301AD2026P01MGC002L12Production

 

thank you

1 ACCEPTED SOLUTION
p45cal
Solution Supplier
Solution Supplier

As follows:

 

p45cal_0-1733332731879.png

 

leaving you with:

 

p45cal_1-1733332777903.png

 

View solution in original post

3 REPLIES 3
ZhangKun
Super User
Super User

If you want to delete the entire row, just filter it. If you just want to delete the value of the Type column (that is, set it to null), you can check the following formula:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tdNNC4JAEAbgvxKePcyMm7seI6GLiuAlEA9RHYJKyfz/uUtTYGsfascdnn0XZnby3CHwYO64TpaAL2QKlKyAlKC2pMvppdw12+uhPDuFa9VLANQa4VtOHB42VW3crD0sQgKpYsDYRGY6Ul/dnKrjvuY4RENRSRECGeoZSgPymCmfGWkmbFEdg1Yj/2a6bZBM1VT08XjwcQacGMCEFPBOyU+ZRjxZy78az2PNez75eJ7178SzKzikK+vozbq9evqtLXZe3AA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [PO = _t, #"ID Code" = _t, Quantity = _t, Type = _t]), 
    // or Table.TransformColumns(Source, {"Type", each if _ <> "Production" then null else _})
    Result = Table.TransformColumns(Source, {"Type", each if List.Contains({"Dups", "Samples"}, _) then null else _})
in
    Result

 

p45cal
Solution Supplier
Solution Supplier

As follows:

 

p45cal_0-1733332731879.png

 

leaving you with:

 

p45cal_1-1733332777903.png

 

jgeddes
Super User
Super User

You cannot delete but you can filter out rows you do not need.
Table.SelectRows(previousQueryStep, each [Type] = "Production") would select all rows that have 'Production' as the value in the Type column.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.