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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Deleting/filtering every row with null values in every column

Hello community,

I have merged 40 tables. Every table has between 100-500 rows  null values across the entire entire row, where there might only be between 5-100 rows with data in them.

I wish to delete all the rows that have null values across all columns after the last row with data in it. How can that be done?

 

My first thought was to replace all nulls and 0's with blanks and then remove use the remove blank rows in a function for all the tables.

 

The issue here is that not all the tables have the exact same amount columns

 

    #"Replaced Value" = Table.ReplaceValue(#"Medie booking - 2022H1_Sheet",null,"",Replacer.ReplaceValue,{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16", "Column17", "Column18", "Column19", "Column20", "Column21", "Column22", "Column23", "Column24", "Column25", "Column26", "Column27", "Column28"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",0,"",Replacer.ReplaceValue,{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16", "Column17", "Column18", "Column19", "Column20", "Column21", "Column22", "Column23", "Column24", "Column25", "Column26", "Column27", "Column28"}),
    #"Removed Blank Rows" = Table.SelectRows(#"Replaced Value1", each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
in
    #"Removed Blank Rows"
1 ACCEPTED SOLUTION
edhans
Super User
Super User

  1. Select all the columns you want @Anonymous to test for null on.
  2. In the Add Column ribbon, select Merge Columns with no special delimiter.
  3. Filter that newly Merged column for null, or select the "remove empty" filter. Remove Empty will remove blanks and nulls.
  4. Delete the temporary merged column.

edhans_0-1634228631337.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
edhans
Super User
Super User

  1. Select all the columns you want @Anonymous to test for null on.
  2. In the Add Column ribbon, select Merge Columns with no special delimiter.
  3. Filter that newly Merged column for null, or select the "remove empty" filter. Remove Empty will remove blanks and nulls.
  4. Delete the temporary merged column.

edhans_0-1634228631337.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

Hello, I edited the text as I discovered that I do not have the exact same amount of columns. Could you take a look at it again?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors