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
Erwin
Helper II
Helper II

Calculate max date over multiple dates in a row

Hi all,

 

Please review below table, called "Requests".

Requests.PNG

 

I need to calculate, for each individual row in the table, the largest value / newest date of the columns [Creation date], [Start date], [Delivery date] and [Verification date].

 

Normally, in PBI, I would create a calculated column "MaxDate" with the following formula:

MaxDate = 
VAR temp={[Creation date],[Start date],[Delivery date],[Verification date]}

RETURN
   MAXX(temp,[Value])

This formula, when used in PBI, would give me the following outcome:

 

requests.PNG

 

However, because of my clients tooling constraints, I have to work with Power Pivot in Excel 2013. The above formula will not work in this tool.

 

I've searched for and tried different options, but can't seem to get it working.

 

Can you help me?

Many thanks in advance!

Erwin

8 REPLIES 8
Zubair_Muhammad
Community Champion
Community Champion

Hi @Erwin

 

You might be able to use the ROW and UNION function in Excel 2013 to achieve the same result

 

=
VAR temp =
    UNION (
        ROW ( "Dates", [Creation date] ),
        ROW ( "Dates", [Start date] ),
        ROW ( "Dates", [Delivery date] ),
        ROW ( "Dates", [Verification date] )
    )
RETURN
    MAXX ( temp, [Dates] )

Regards
Zubair

Please try my custom visuals

Hi Zubair,

 

Unfortunately the UNION function is also not accepted by Excel 2013.

 

This is the type of solution I'm thinking about:

MAXX(
        <SomeTable, dynamically created to contain four dates per row>,
        [SomeTable]
)

 

Do you have any other ideas?

Erwin

@Erwin

 

Can you use GENERATESERIES in Excel 2013?

 

 


Regards
Zubair

Please try my custom visuals

@Erwin

 

The old fashioned way should work

 

=
MAX (
    MAX ( MAX ( [Creation date], [Start date] ), [Delivery date] ),
    [Verification date]
)

 


Regards
Zubair

Please try my custom visuals

@Erwin

 

Max takes only 2 arguments. So we have to nest them


Regards
Zubair

Please try my custom visuals

Hi Zubair,

 

Still doesn't work. In your example you are still putting four dates in one MAX function, which is not allowed.

 

I'm trying to calculate over a dynamic table using MAXX and ROW, but I can't seem to work what the expression should be (argument 2 of MAXX).

 

=MAXX( 
            ROW(
                      "Create",MAXX(VALUES(Requests[Request]),Requests[Creation date]),
                      "Start",MAXX(VALUES(Requests[Request]),Requests[Start date]),
                      "Deliver",MAXX(VALUES(Requests[Request]),Requests[Delivery date]),
                      "Verify",MAXX(VALUES(Requests[Request]),Requests[Verification date])
            ),
            <What goes here???>
)

 

Hi

I am not putting 4 values in one function
Please take a look carefully

I am taking max of max of max with 2 columns in each

Regards
Zubair

Please try my custom visuals

Nope, just GENERATE and GENERATEALL

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.