Forum Discussion
Anonymous
2 years agoNot applicable
Help removing a row based on one duplicate column and a different column condition
Hello I am finding some similar questions but nothing for my exact situation. Relatively new to Power Query and Power BI. I am trying to find a way to remove a row that has duplicate data in one colu...
dufoq3
Community Champion
2 years agoHi Anonymous, I'm refering to spinfuzer sample data (same result with different approach):
Change 2nd step YourSource = Source (refer instead of Source to your data):
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUXLKzMlJTVGK1YlWSkLlJqNyU1C5qajcNEyuY0FRZg6Ylw7kuaUmFZUmFlXCBZBUZyBxYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [SKU = _t, #"Forecast Month" = _t]),
YourSource = Source,
GroupedRows = Table.Group(YourSource, {"SKU"}, {{"Forecast Month", each (if Table.RowCount(_) = 1 then _ else Table.SelectRows(_, (r)=> r[Forecast Month] <> "Billed")){0}[Forecast Month], type text}})
in
GroupedRows