+ Reply to Thread
Results 1 to 5 of 5

DAX Date Function from Range

  1. #1
    Forum Contributor
    Join Date
    10-09-2015
    Location
    Canada
    MS-Off Ver
    Office Home and Student 2021 for Mac
    Posts
    170

    DAX Date Function from Range

    Hi all,

    I'm currently working with a fairly large data set within power pivot (approximately 1 million rows of data), and am trying to find the earliest date that correspond to a range of IDs that repeat, but are scattered throughout.

    For example,

    1234 February 2, 2012
    5555 May 2, 2004
    7777 July 2, 2004
    7777 May 6, 2002
    1234 August 8, 1997
    1234 December 12, 2012
    5555 December 22, 1999
    0000 August 8, 2008
    0000 July 7, 2007

    I tried the FIRSTDATE and MIN functions, but they didn't seem to work. Essentially, I am looking for a function that will display the earliest start date for 1234, 5555, 7777, etc...I'm fairly certain there is a middle-man function that's escaping me.

    Any help would be greatly appreciated!

    D.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: DAX Date Function from Range

    Is this to go into a separate table, where you have already listed the IDs like 1234, 5555, 7777 etc., or do you want the earliest date to be displayed on the row of first occurrence of each ID?

    You can do this with an array formula, along the lines of:

    =MIN(IF(conditions,date_range))

    where conditions will be something like:

    ID_range = ID_cell

    This is a bit vague, but if you can tell us which columns you are using then I can flesh it out for you.

    Hope this helps.

    Pete

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: DAX Date Function from Range

    Hi,

    Are you trying to create a calculated column in your table or do you want the result in a pivot table, in which case a simple MIN measure should suffice?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Forum Contributor
    Join Date
    10-09-2015
    Location
    Canada
    MS-Off Ver
    Office Home and Student 2021 for Mac
    Posts
    170

    Re: DAX Date Function from Range

    Hi there, this actually worked perfectly. Thanks so much!

    Quote Originally Posted by Pete_UK View Post
    Is this to go into a separate table, where you have already listed the IDs like 1234, 5555, 7777 etc., or do you want the earliest date to be displayed on the row of first occurrence of each ID?

    You can do this with an array formula, along the lines of:

    =MIN(IF(conditions,date_range))

    where conditions will be something like:

    ID_range = ID_cell

    This is a bit vague, but if you can tell us which columns you are using then I can flesh it out for you.

    Hope this helps.

    Pete

  5. #5
    Forum Contributor
    Join Date
    10-09-2015
    Location
    Canada
    MS-Off Ver
    Office Home and Student 2021 for Mac
    Posts
    170

    Re: DAX Date Function from Range

    A simple MIN would be okay, which I also tried and worked quite well! Thanks!

    Quote Originally Posted by xlnitwit View Post
    Hi,

    Are you trying to create a calculated column in your table or do you want the result in a pivot table, in which case a simple MIN measure should suffice?

+ 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: 1
    Last Post: 11-24-2015, 03:00 AM
  2. IF Function and date range
    By chadduquesne in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 06-16-2015, 07:08 AM
  3. IF function finding a date in a date range
    By KelleyScott in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-29-2015, 06:26 AM
  4. Replies: 0
    Last Post: 05-30-2013, 07:50 PM
  5. Function that will create a range based on a start date and end date
    By ckosman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2013, 10:09 PM
  6. [SOLVED] SUMIF within date range as a function of today()'s date
    By irvine79 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-06-2006, 01:00 PM
  7. [SOLVED] MAX figure within a date range as a function of today()'s date
    By irvine79 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-06-2006, 12:45 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