+ Reply to Thread
Results 1 to 2 of 2

PowerQuery/Dax - Valid Date Look-up

  1. #1
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92

    PowerQuery/Dax - Valid Date Look-up

    Hi All,

    I have two tables with the following information:

    1. Rates
    - Contract#
    - WorkingClass
    - RateofPay
    - EffectiveDate

    2. LaborDetail
    - Contract#
    - WorkingClass
    - DateWorked
    - HoursWorked

    These are both Many-to-Many tables.

    Somehow, I need to relate the two so that I can pull information on the labordetail table when the 'effectivedate' applies.
    - Rateofpay pulled into the LaborDetail can only occur IF the 'DateWorked' is ">=" the 'effectivedate'
    - The rate pulled also needs to correspond with the 'latest' effective date as the rates change with each 'new' effectivedate brought into the database

    The problem is that there are several effective dates for each contract#+workingclass Unique ID (if that were build). So, forcing a relationship, ends up having a 'rateofpay' pulled into the LaborDetail table that ignores the rule of 'effectivedates'.

    I'm stumped on this and could use all the help/guidance out there.

  2. #2
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92

    Re: PowerQuery/Dax - Valid Date Look-up

    Okay. After banging my head against a wall for the greater part of a few hours, I've come up with a solution.

    In the Rates Table, I'll add a new column: "max" given the unique identifer "contract#+workingclass"; the "max" will pull the highest value on the effective date.

    This is how I will resolve the issue of incorrect rates;

    How i'll do this.. no clue.

+ 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. VBA vs PowerQuery
    By Trachr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2017, 11:50 PM
  2. PowerQuery and VBA
    By Trachr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2017, 12:10 AM
  3. Help with powerquery.
    By stephme55 in forum Excel General
    Replies: 0
    Last Post: 09-01-2016, 07:31 PM
  4. VBA - Display Next Valid Date
    By Whang56 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2013, 12:29 PM
  5. Next valid date, exclude holiday / Sat / Sun
    By phil77 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-27-2010, 04:56 PM
  6. [SOLVED] How to check valid Date value?
    By hstijnen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-14-2006, 08:30 AM
  7. Check if date is valid
    By Lava in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2005, 10:28 AM

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