Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe 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
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.
| PO | ID Code | Quantity | Type |
| 20305 | SN0647P02NG02842 | 5 | Production |
| 20305 | SN0647P02NGC0012 | 10 | Production |
| 20305 | SN0647P02NGC0022 | 5 | Dups |
| AD2078M01MGC001S | 1 | Samples | |
| 20311 | AD1874D02MGC003S | 12 | Dups |
| AD2078M01MGC001S | 1 | Samples | |
| AD2086M01MGC002S | 4 | Dups | |
| AD2086M01MGC002S | 1 | Dups | |
| AD2087M01MGC002S | 1 | Dups | |
| AD2087M01MGC002S | 1 | Dups | |
| AD2087M01MGC002S | 1 | Samples | |
| 20317 | AD2088M01MGC002S | 1 | Samples |
| 20317 | AD2088M01MGC002S | 1 | Samples |
| AD2089M01MGC001S | 1 | Samples | |
| 20317 | AD2090M01MGC001S | 1 | Samples |
| 20317 | AD2090M01MGC001S | 1 | Samples |
| 20301 | AD2026P01MGC001L | 12 | Production |
| 20301 | AD2026P01MGC001L | 12 | Production |
| 20301 | AD2026P01MGC001M | 15 | Production |
| 20301 | AD2026P01MGC001M | 15 | Production |
| 20301 | AD2026P01MGC001S | 10 | Production |
| 20317 | AD2091M01MGC001S | 1 | Samples |
| 20301 | AD2026P01MGC001XL | 10 | Production |
| 20301 | AD2026P01MGC002L | 12 | Production |
| 20301 | AD2026P01MGC002L | 12 | Production |
thank you
Solved! Go to Solution.
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
As follows:
leaving you with:
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.
Proud to be a Super User! | |
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 6 | |
| 5 |