+ Reply to Thread
Results 1 to 5 of 5

Power Query Custom Column: If date is null, calculate from another date column

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

    Power Query Custom Column: If date is null, calculate from another date column

    I am attempting to write a formula in Power Query to add a new date column. The formula should add 90 days to a date in date column 1. if cell is null in date column 1 add 90 days to the date in date column 2. I have pasted me code below

    = Table.AddColumn(#"Changed Type3", "90 Days", each if [#"Change Date (FT)"] = null then Date.AddDays([#"FT-Date"], 90) else Date.AddDays([#"Change Date (FT)"], 90)


    I am receiving a syntax error: "Token RightParen expected."
    Apologies if this has already been answered.

    Thank you in advance.
    Last edited by jekeith; 04-26-2018 at 10:18 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Power Query Custom Column: If date is null, calculate from another date column

    Looks like you are missing the final closing parenthesis

    in your syntax the final ) corresponds to .AddDays function. Add another to close off .AddColumn
    Cheers
    Andy
    www.andypope.info

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

    Re: Power Query Custom Column: If date is null, calculate from another date column

    Thanks Andy. I closed off the Add.Column but I am still receiving the same error. Just to double check, what I am trying to do is possible, correct?

    Edit: My mistake. I"m having an issue with (#"Changed Type3", call. I am editing the formula and it must be an issue of action order?
    Last edited by jekeith; 04-26-2018 at 11:07 AM. Reason: Correction to what is happening

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Power Query Custom Column: If date is null, calculate from another date column

    This syntax works for me.

    Please Login or Register  to view this content.
    I see that "Changed Type" is the name of a previous step within the editor. So as long as your match it should be okay
    Last edited by Andy Pope; 04-26-2018 at 11:32 AM.

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

    Re: Power Query Custom Column: If date is null, calculate from another date column

    Excellent. Thank you very much for your prompt assistance.

+ 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. [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
  2. Replies: 6
    Last Post: 12-07-2016, 02:36 AM
  3. Replies: 6
    Last Post: 12-07-2016, 12:28 AM
  4. Replies: 1
    Last Post: 12-06-2016, 06:28 PM
  5. 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
  6. Replies: 3
    Last Post: 04-08-2016, 09:11 AM
  7. Filter Row using Date and Column using Null Cells
    By lui_roc in forum Excel General
    Replies: 0
    Last Post: 06-10-2008, 12:15 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