Forum Discussion
Removing Rows - http://community.powerbi.com/t5/Desktop/Removing-rows-in-Power-Bi/m-p/48104#M19015
I am trying to removing rows using parameters as indicated in the post above.
I have created the parameter but I did not understand how to delete the rows that match with parameter.
I can filter according to parameter but I can't delete.
Could you help me please?
Thanks
It filters them in the query so that those rows are never imported into the data model so they are essentially "deleted" as part of the data load. This will not remove them from the source file but the data model will not have those rows in it. This is just a step in the query, you would have to return the rows from that line of the query. A full example query would be:
let Source = Csv.Document(File.Contents("C:\temp\powerbi\departments.csv"),[Delimiter=",", Columns=3, Encoding=1252, QuoteStyle=QuoteStyle.None]), #"Promoted Headers" = Table.PromoteHeaders(Source), #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Department", Int64.Type}, {"Name", type text}, {"DeptType", type text}}), #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Name] <> "Dept3")) in #"Filtered Rows"
9 Replies
- Greg_DecklerCommunity Champion
I may not be understanding correctly, but you would need to use the parameter to filter in the query so that the data never makes it into the model. Are you trying to import everything and then delete it from the model? Or are you trying to delete it from the source?
- gpieroSkilled Sharer
You are right since you do not know the background.
I am importing big data from ERP. The transaction that generates repeat on each page the column header.
Then shaping data, I need to remove all rows that contain the string that correspond to the column header.
- Greg_DecklerCommunity Champion
Is there just one source and one format for the data being imported? You could essentially just set a filter on one of the columns to filter out all "Codice materiale" values in the "Codice materiale" column.