• 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
  • Login

How can one conditionally delete some selected columns in Powerquery|Power Query|Excel Forum|My Online Training Hub

You are here: Home / How can one conditionally delete some selected columns in Powerquery|Power Query|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
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 one conditionally delete so…
sp_PrintTopic sp_TopicIcon
How can one conditionally delete some selected columns in Powerquery
Avatar
Femco Onuch
Member
Members
Level 0
Forum Posts: 28
Member Since:
May 6, 2022
sp_UserOfflineSmall Offline
1
May 25, 2022 - 6:12 pm
sp_Permalink sp_Print sp_EditHistory
 
I have a set of data and i wish to REPLACE some column(s) that contains values 1, 1, F adjacent to each other. whenever powerquery sees these set of three columns adjacent to each other containing 1,1, F respectively.I want it to replace the group of columns in that set of values to say 0, 0, * i know how to replace values with another value, buh i want just whenever the occurence of these values showed, to get it replaced in set. I have been strongly to resolve these for sometimes buh to no avail.
Click here and see the challenge: https://ibb.co/Bf3zGRn

Image Enlarger

sp_AnswersTopicSeeAnswer See Answer
Avatar
Jessica Stewart
Northern USA
Member
Members


Trusted Members
Level 0
Forum Posts: 219
Member Since:
February 13, 2021
sp_UserOfflineSmall Offline
2
May 26, 2022 - 12:40 am
sp_Permalink sp_Print

Add custom column if [exammth]=1 and [mth]=1 and [mthgrade]="F" then [exammth]=0 and [mth]=0 and [mthgrade]="*"

Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 1
Forum Posts: 605
Member Since:
January 31, 2022
sp_UserOfflineSmall Offline
3
May 26, 2022 - 10:21 pm
sp_Permalink sp_Print

Hi Femco,

I couldn't get Jessica's proposed solution it to work, but the attached workbook contains a small scale example on a table with just 5 columns and 4 rows. I trust that you can identify the relevant steps that select the relevant columns and replaces the 1-1-F sequence with 0-0-*

If you don't succeed, you can perhaps upload a file with the exact structure as your real one, though without real names of real people.

sp_AnswersTopicAnswer
Answers Post
Avatar
Jessica Stewart
Northern USA
Member
Members


Trusted Members
Level 0
Forum Posts: 219
Member Since:
February 13, 2021
sp_UserOfflineSmall Offline
4
May 27, 2022 - 12:48 am
sp_Permalink sp_Print

Seeing Riny's solution I can visualize the problem better and see where I made my mistake, we're looking at 3 columns instead of 1 (which I knew but somehow my brain didn't fully register). Go with his solution. 🙂

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Robert Hernandez, Lakisha Hall, QSolutions Group
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
jaryszek: 183
Newest Members:
Lisa Myers
David von Kleek
Ronald White
Ginette Guevremont
Taryn Ambrosi
Mark Davenport
Christy Nichols
Harald Endres
Ashley Hughes
Herbie Key
Forum Stats:
Groups: 3
Forums: 24
Topics: 6528
Posts: 28594

 

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

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • 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

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

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

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.