+ Reply to Thread
Results 1 to 2 of 2

Power Query conditional column on date

  1. #1
    Registered User
    Join Date
    01-12-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    53

    Question Power Query conditional column on date

    Hello,

    I am trying to insert a conditional column in a Power Query. It needs to introduce a column with a value dependent on {Last Covid Test Date}; if the date is greater or equal with TODAY() date -7 it should read YES, if not it should read NO
    I know how to do that in Excel, no idea though how to write the formula in M.
    Could any of you please help?

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Power Query conditional column on date

    Hi aldenes,

    I find an "Age" function in Power Query that might do what you want. See the attached where you can see how it is used.
    Covid Last Week YN.xlsx
    In PQ you need to select the date column and then click on Add Column and then the calendar icon. Select the "AGE" and then days and input 7. It will build the formula for you.

    Hope that helps.
    Last edited by MarvinP; 10-28-2020 at 11:40 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Power Query Conditional Column
    By MartinvanK in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-28-2020, 12:00 PM
  2. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  3. Custom Permutations Column in Power Query from two columns in the same Query
    By PaintPaddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2019, 02:48 PM
  4. [SOLVED] Power Pivot does not load new column added in Power query
    By ibuhary in forum Excel General
    Replies: 12
    Last Post: 02-19-2019, 03:53 AM
  5. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  6. Replies: 4
    Last Post: 04-26-2018, 11:35 AM
  7. [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

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