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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
bolabuga
Helper V
Helper V

using [TableAction.DeleteRows]

Hello everyone, a little help in here.

 

i have a table.selectrows(#renamed columns2, each ([REFER] <> "1610"))

 

What i want to do is DELETE [REFER] = 1610, because its incomplete, and i will need to append 1610(oct/2016) in a few days. because of this situation i need to remove the incomplete month of my table or i will create duplicates of everything on october when trying to add the data.

1 ACCEPTED SOLUTION
v-haibl-msft
Microsoft Employee
Microsoft Employee

@bolabuga

 

Table.SelectRows will only filter the table rows. To remove the specific rows, we can first add an conditional column to mark the rows which equal 1610. Then sort this mark column and delete the first N rows. At last we just need to delete the mark column.

 

using [TableAction.DeleteRows]_1.jpgusing [TableAction.DeleteRows]_2.jpgusing [TableAction.DeleteRows]_3.jpg

 

    #"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Custom", each if [REFER] = 1610 then "delete" else null ),
    #"Sorted Rows" = Table.Sort(#"Added Conditional Column",{{"Custom", Order.Descending}}),
    #"Removed Top Rows" = Table.Skip(#"Sorted Rows",2),
    #"Removed Columns" = Table.RemoveColumns(#"Removed Top Rows",{"Custom"})

 

Best Regards,

Herbert

View solution in original post

5 REPLIES 5
v-haibl-msft
Microsoft Employee
Microsoft Employee

@bolabuga

 

Table.SelectRows will only filter the table rows. To remove the specific rows, we can first add an conditional column to mark the rows which equal 1610. Then sort this mark column and delete the first N rows. At last we just need to delete the mark column.

 

using [TableAction.DeleteRows]_1.jpgusing [TableAction.DeleteRows]_2.jpgusing [TableAction.DeleteRows]_3.jpg

 

    #"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Custom", each if [REFER] = 1610 then "delete" else null ),
    #"Sorted Rows" = Table.Sort(#"Added Conditional Column",{{"Custom", Order.Descending}}),
    #"Removed Top Rows" = Table.Skip(#"Sorted Rows",2),
    #"Removed Columns" = Table.RemoveColumns(#"Removed Top Rows",{"Custom"})

 

Best Regards,

Herbert

Really thks Herbert_liu, that solves the problem for me 🙂

LaurentCouartou
Solution Supplier
Solution Supplier

The description of what you want to achieve is clear, but your post lacks a question.

 

At first glance, your expression looks fine.

 

How can we help you?

Oh sorry, the table.selectrows is what i managed to do. i want to delete the refer = 1610

 

Maybe is my lack of understanding, but. 

 

1- i have a incomplete month oct/2016 (refer=1610) excluded on a table.selectrows filter

2-if i append a complete oct/2016 table on my query, it will not duplicate with the fields filtered on the select row command?? i mean, i will have to remove the filter when i have the oct/2016 complete table in a few days.

 

I would like to use "TableAction.DeleteRows" to remove anything from my query that have REFER = 1610, but im not being able to use the command properly.

I had never heard or read about these Action functions before your question and just read more about them on the MSDN web site.

 

The query editor in Power BI tells me TableAction.DeleteRows is not a recognized name (a.k.a not implemented yet), but maybe I missed an update or something.

 

 

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.

Top Solution Authors