+ Reply to Thread
Results 1 to 4 of 4

Power Query - Price List using Date of Sale

  1. #1
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    Power Query - Price List using Date of Sale

    I want to include in table Transactions the Price that was effective at the date of the Sales (as per table Pricelist).

    I suspect that its the M Code e equivalent of Excel's Vlookup ... but I'm not sure how to go about it.

    Any ideas I could try?


    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Power Query - Price List using Date of Sale

    in PQ:

    1. Merge the 2 tables with Full Outer using the dates.

    2. Add Conditional Column. If Date = null, then show Effective column. Else, show Date column.

    3. Sort the new Conditional Column in ascending order.

    4. Fill Down for the new Price column.

    5. Remove the Effective Date column and Conditional column.

    6. Filter away the null values.

    you can watch this video as well:
    https://www.youtube.com/watch?v=Fo-lGE6vgJM

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,896

    Re: Power Query - Price List using Date of Sale

    This link should help you to make it happen. I would first change the second table with pricing to a start and end date and then use this link to do your join.

    https://radacad.com/dates-between-me...in-power-query
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302
    Quote Originally Posted by benishiryo View Post
    in PQ:

    1. Merge the 2 tables with Full Outer using the dates.

    2. Add Conditional Column. If Date = null, then show Effective column. Else, show Date column.

    3. Sort the new Conditional Column in ascending order.

    4. Fill Down for the new Price column.

    5. Remove the Effective Date column and Conditional column.

    6. Filter away the null values.

    you can watch this video as well:
    https://www.youtube.com/watch?v=Fo-lGE6vgJM
    I now need to look up on two Columns - What is the Price for Customer ABC at date X.

    Can I use the same approach or is there another approach in PQ - I've tried but I think the solution is only good for one column lookup.

    Thanks

    Allister
    Attached Files Attached Files
    Last edited by AllisterB; 02-16-2021 at 02:40 PM.

+ 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. Replies: 3
    Last Post: 10-10-2020, 01:14 AM
  2. Power Query - Date List with changing variable
    By Steveapa in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-17-2020, 04:54 PM
  3. Power Query - Date List with changing variable
    By Steveapa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2020, 12:27 PM
  4. Calculate Vendor price to Sale Price
    By wstring in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-09-2019, 01:24 PM
  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. [SOLVED] FIND PRICE COST from MAX DATE based on ITEM ID and SALE DATE
    By aetedford in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-18-2018, 11:29 AM
  7. Calc Final Sale Price Including % of Sale?
    By kierenschneider in forum Excel General
    Replies: 1
    Last Post: 10-26-2009, 01:09 PM

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