Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sdaniels
Regular Visitor

Finding the highest Date in a record

Community,

 

I'm stumped on this one.  I have a series of projects that have 4 date records associated with them.  I need to create a measurement that computes the number of days between the activcation date and one of the 3 previous dates, but always selecting the highest date of the 3 values.  If the measurement is under 5 days it is a bonus for sales.  Sometimes there are missing values in some of the dates.

 

How can I do this without creating a massive IF nested loop calculation?

 

Ex Date

Sold Date         Advised Date        Quoted date      Activation Date       # of days to Activation

10/1/2017          10/5/2017             10/3/2017          10/10/2017             5

11/1/2017                                        11/6/2017          11/10/2017            4 (Bonus)

11/1/2017           11/16/2017           11/2/2017          11/10/2017            8  (advised is past the activation)

 

Thanks for the help,

 

Scott

1 ACCEPTED SOLUTION

Hi @sdaniels and @pxg08680

 

How abou this calculated column

 

=
DATEDIFF (
    MAXX (
        FILTER (
            UNION (
                ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Sold Date] ) ) ),
                ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Advised Date] ) ) ),
                ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Quoted date] ) ) )
            ),
            [MyDates] <= Table1[Activation Date]
        ),
        [MyDates]
    ),
    Table1[Activation Date],
    DAY
)

Regards
Zubair

Please try my custom visuals

View solution in original post

10 REPLIES 10

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.