• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

How can I remove rows if M1,T1,W1,Th1, and F1 are "null"?|Power Query|Excel Forum|My Online Training Hub

You are here: Home / How can I remove rows if M1,T1,W1,Th1, and F1 are "null"?|Power Query|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryHow can I remove rows if M1,T1,W1,T…
sp_PrintTopic sp_TopicIcon
How can I remove rows if M1,T1,W1,Th1, and F1 are "null"?
Avatar
Jim Chen
Member
Members

Power BI
Level 0
Forum Posts: 59
Member Since:
February 20, 2019
sp_UserOfflineSmall Offline
1
May 23, 2023 - 11:05 am
sp_Permalink sp_Print

How can I remove rows only when M1,T1,W1,Th1, and F1 are all "null"?

sp_PlupAttachments Attachments
  • sp_PlupImage Remove-Rows-with-null.png (83 KB)
Avatar
Alan Sidman
Steamboat Springs, CO
Member
Members


Trusted Members
Level 0
Forum Posts: 150
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
2
May 23, 2023 - 11:18 am
sp_Permalink sp_Print

Pictures are really nice, but cannot manipulate data in them. Suggest you upload a sample file that we can work with. Don't ask us to recreate your file for you. We may not format the same way and it may result in an incorrect solution. Also, it takes time to do what you already have.

Avatar
Graeme Wright

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
October 27, 2020
sp_UserOfflineSmall Offline
3
May 23, 2023 - 3:36 pm
sp_Permalink sp_Print

One way would be to create a Custom column (You can call it the "Keeper") with the formula:
if ([M1] = null and [T1] = null and [W1] = null and [Th1] = null and [F1] = null) then "Remove" else "Keep"
Then filter out "Remove" from the "Keeper" column, then remove the "Keeper".

Avatar
Jim Chen
Member
Members

Power BI
Level 0
Forum Posts: 59
Member Since:
February 20, 2019
sp_UserOfflineSmall Offline
4
May 24, 2023 - 6:22 am
sp_Permalink sp_Print

@Greame, The solution above is great. I tested it and it works. Thanks a lot!

@Alan, I attached a zipped file here or you may use Dropbox link below. If you have a better solution, please let me know,

https://www.dropbox.com/s/zpiz.....s.zip?dl=0

Thank you all!

Jim

Avatar
Alan Sidman
Steamboat Springs, CO
Member
Members


Trusted Members
Level 0
Forum Posts: 150
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
5
May 24, 2023 - 7:25 am
sp_Permalink sp_Print

1. Once imported to PQE, replace all null with zero
2. Set the data type for the columns in question to whole numbers
3. Add the columns (in a new column) and then filter out any that equal zero.

Note: Once I did the above-in your example there were no rows that were equal to zero, ie blank.

let
Source = Excel.CurrentWorkbook(){[Name="Table_SC_In_Person"]}[Content],
#"Replaced Value" = Table.ReplaceValue(Source,null,0,Replacer.ReplaceValue,{"M1", "T1", "W1", "Th1", "F1", "M2", "T2", "W2", "Th2", "F2", "M3", "T3", "W3", "Th3", "F3", "M4", "T4", "W4", "Th4", "F4", "M5", "T5", "W5", "Th5", "F5", "M6", "T6", "W6", "Th6", "F6", "M7", "T7", "W7", "Th7", "F7", "M8", "T8", "W8", "Th8", "F8", "M9", "T9", "W9", "Th9", "F9", "M10", "T10", "W10", "Th10", "F10"}),
#"Changed Type" = Table.TransformColumnTypes(#"Replaced Value",{{"M1", Int64.Type}, {"T1", Int64.Type}, {"W1", Int64.Type}, {"Th1", Int64.Type}, {"F1", Int64.Type}, {"M2", Int64.Type}, {"T2", Int64.Type}, {"W2", Int64.Type}, {"Th2", Int64.Type}, {"F2", Int64.Type}, {"M3", Int64.Type}, {"T3", Int64.Type}, {"W3", Int64.Type}, {"Th3", Int64.Type}, {"F3", Int64.Type}, {"M4", Int64.Type}, {"T4", Int64.Type}, {"W4", Int64.Type}, {"Th4", Int64.Type}, {"F4", Int64.Type}, {"M5", Int64.Type}, {"T5", Int64.Type}, {"W5", Int64.Type}, {"Th5", Int64.Type}, {"F5", Int64.Type}, {"M6", Int64.Type}, {"T6", Int64.Type}, {"W6", Int64.Type}, {"Th6", Int64.Type}, {"F6", Int64.Type}, {"M7", Int64.Type}, {"T7", Int64.Type}, {"W7", Int64.Type}, {"Th7", Int64.Type}, {"F7", Int64.Type}, {"M8", Int64.Type}, {"T8", Int64.Type}, {"W8", Int64.Type}, {"Th8", Int64.Type}, {"F8", Int64.Type}, {"M9", Int64.Type}, {"T9", Int64.Type}, {"W9", Int64.Type}, {"Th9", Int64.Type}, {"F9", Int64.Type}, {"M10", Int64.Type}, {"T10", Int64.Type}, {"W10", Int64.Type}, {"Th10", Int64.Type}, {"F10", Int64.Type}}),
#"Inserted Sum" = Table.AddColumn(#"Changed Type", "Addition", each List.Sum({[M1], [T1], [W1], [Th1], [F1], [M2], [T2], [W2], [Th2], [F2], [M3], [T3], [W3], [Th3], [F3], [M4], [T4], [W4], [Th4], [F4], [M5], [T5], [W5], [Th5], [F5], [M6], [T6], [W6], [Th6], [F6], [M7], [T7], [W7], [Th7], [F7], [M8], [T8], [W8], [Th8], [F8], [M9], [T9], [W9], [Th9], [F9], [M10], [T10], [W10], [Th10], [F10]}), Int64.Type),
#"Filtered Rows" = Table.SelectRows(#"Inserted Sum", each true)
in
#"Filtered Rows"

Avatar
Jim Chen
Member
Members

Power BI
Level 0
Forum Posts: 59
Member Since:
February 20, 2019
sp_UserOfflineSmall Offline
6
May 27, 2023 - 7:17 am
sp_Permalink sp_Print

it works perfectly. Thanks!

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Magnolia Stellata
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 216
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Melanie Ford
Isaac Felbah
Adele Glover
Hitesh Asrani
Rohan Abraham
Anthony van Riessen
Erlinda Eloriaga
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Forum Stats:
Groups: 3
Forums: 24
Topics: 6356
Posts: 27793

 

Member Stats:
Guest Posters: 49
Members: 32324
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.