cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Post Prodigy

## Nested MIN/MAX

Hello

I have the table:

 Col1 Col2 Col3 A 1 01/01/2000 A 2 02/01/2000 A 1 03/01/2000 A 2 04/01/2000 A 1 05/01/2000 A 1 06/01/2000 A 1 07/01/2000

etc

After grouping by Col1 (which can be A, B, etc), I want to find the earliest date where Col2=1 after the latest date where Col2=2 for that group A (or B, C etc).

Any idea?

Thanks!

1 ACCEPTED SOLUTION
Super User

Are you expecting this kind of result?

You can use the measures below:

Earliest Date =
CALCULATE ( MIN ( Data[Col3] ), Data[Col2] = 1, ALLEXCEPT ( Data, Data[Col1] ) )
Latest Date =
CALCULATE ( MAX ( Data[Col3] ), Data[Col2] = 2, ALLEXCEPT ( Data, Data[Col1] ) )

Proud to be a Super User!

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
2 REPLIES 2
Super User

Are you expecting this kind of result?

You can use the measures below:

Earliest Date =
CALCULATE ( MIN ( Data[Col3] ), Data[Col2] = 1, ALLEXCEPT ( Data, Data[Col1] ) )
Latest Date =
CALCULATE ( MAX ( Data[Col3] ), Data[Col2] = 2, ALLEXCEPT ( Data, Data[Col1] ) )

Proud to be a Super User!

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Super User

Hi @UsePowerBI ,

Col2=1 after the latest date where Col2=2

Proud to be a Super User!

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.