Forum Discussion
LoxleyLearner
5 years agoNew Member
Delete rows - based on one blank column only
I'm looking at the BP world energy report and have the tall thin dataset downloaded. It uses ISO3 values (great) but in the ISO3 column has blanks for regional summaries (not so great as these sum t...
- 5 years ago
Hi LoxleyLearner ,
Is it like this?
Please try this M code.
let Source = Excel.Workbook(File.Contents("C:\Users\lionelch\Desktop\Sampledata\Data\content\Chapter_1\2015 Sales.xlsx"), null, true), Sales_Table = Source{[Item="Sales",Kind="Table"]}[Data], #"Changed Type" = Table.TransformColumnTypes(Sales_Table,{{"CountryRegion", type text}, {"Brand", type text}, {"Month", type text}, {"Sale 2013", type any}, {"Sale 2014", type number}, {"Sale 2015", Int64.Type}}), #"Filtered Rows" = Table.SelectRows( #"Changed Type", each ([CountryRegion] <> null and [CountryRegion] <> "") and ([Brand] <> null and [Brand] <> "") and ([Month] <> null and [Month] <> "") and ([Sale 2013] <> null and [Sale 2013] <> "") and ([Sale 2014] <> null and [Sale 2014] <> "") and ([Sale 2015] <> null and [Sale 2015] <> "") ) in #"Filtered Rows"Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
parry2k
Super User
5 years agoLoxleyLearner you can filter your table for that specific column, and filter where value is not "" or null
LoxleyLearner
5 years agoNew Member
I can see how I can do that when creating the visualisation (a bubble map selecting filter removing null etc) but this has performance implications importing 40,000 not needed rows. How do I do this in data transformation so that I right size my dataset on import?