Results 1 to 6 of 6

Power Query Custom Column: If number in columns a or b are less than 1 then 0 else 1

Threaded View

  1. #1
    Registered User
    Join Date
    04-25-2018
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    34

    Power Query Custom Column: If number in columns a or b are less than 1 then 0 else 1

    Hello,

    I am attempting to add a custom logical column in an excel power query. The new column should be a 0 or 1 based on whether the number in columns a or b are less than or greater than 1. Attached below is a spreadsheet with some data to explain what I am trying to achieve. With the code below i am able to get the column I desire, however, when there is a null value in column A, and the corresponding cell in column b does have a value, the calculated cell in the custom column results in an error. I would like the formula to ignore cells that are null and calculate using the non-empty cell. For instance, cell in column a is null, cell in column b is 1.5 my code below throws an error, but i would like it to return a value of 1 for being greater than 1.

    = if [Column a] < 1 or [column b] < 1 then 0 else 1

    Thank you in advance.
    Attached Files Attached Files
    Last edited by jekeith; 05-15-2018 at 10:10 AM. Reason: for clarity

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 04-26-2018, 11:35 AM
  2. [SOLVED] Insert a date value as a Custom Column in Power Query
    By heytherejem in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-28-2018, 12:42 PM
  3. Power Query - Invoke Custom Function
    By leukep in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2017, 02:18 PM
  4. Unpivot in Power Query keeping two columns
    By PennyK in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-10-2017, 06:27 AM
  5. Return closest value less than given number matching another column - Power Query ?
    By ChipsSlave in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-29-2017, 03:16 PM
  6. Help with Power Query Custom Column Formula
    By travis.cook21 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-16-2016, 01:45 PM
  7. How to remove null values from several columns with Power Query?
    By toblju in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2016, 11:08 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1