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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
awff
Helper III
Helper III

Finding the earliest date across multiple rows

Hi fellow PBI'ers,

I'm trying to create a measure that lists the earliest date a product was held by customers. 

 

Below is a simplified mock up data with the earliest dates bolded:

 

ClientProductStart DateEnd Date
A11-Jan-211-Jan-22
A11-Jun-101-May-10
B21-Dec-211-Dec-22
B31-Apr-211-Apr-22
B21-May-191-May-20
C31-Feb-211-Feb-22
C31-Mar-211-Mar-22


The result ideally should list the earliest date possible per customer by product:

ClientProductEarliest Date
A11-Jun-10
B21-May-19
B31-Apr-21
C31-Feb-21

 

I'm assuming it will be a combination of SUMMARIZE and ALL however, for some reason my results are either:
* Earliest date of the most recent row or;
* Earliest date for each product but across ALL clients rather than per client and product.

1 ACCEPTED SOLUTION

Hi @awff ,

 

Try this measure to see if this will meet your needs:

Measure = CALCULATE(MIN('Table'[Start Date]),ALLEXCEPT('Table','Table'[Client],'Table'[Product]))

Vlianlmsft_0-1644285215631.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
awff
Helper III
Helper III

I played around with the syntax and this seems to work as a measure:

First Start Date = 
Calculate(
    FIRSTDATE(table[Start Date]),
    Filter(
        ALLEXCEPT(table, table[Account], table[Product]),
        table[Start Date] <= Min(table[Start Date])))

 Cross checking with a small sample of the data seemed to return the correct values so far.

Ok, So this only seems to work when drilled down clicking on a row in the table.

 

But when not filtered, It seems to returning the earliest date of the entire data set for the particular product!

Hi @awff ,

 

Try this measure to see if this will meet your needs:

Measure = CALCULATE(MIN('Table'[Start Date]),ALLEXCEPT('Table','Table'[Client],'Table'[Product]))

Vlianlmsft_0-1644285215631.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

SteveHailey
Solution Specialist
Solution Specialist

Hey @awff. This should do the trick:

New Table = 
ADDCOLUMNS(
    SUMMARIZE( 'Table', 'Table'[Client], 'Table'[Product] ),
    "Earliest Date", CALCULATE( MIN( 'Table'[Start Date] ) )
)

Thanks @SteveHailey ,

I'm assuming this is for a new table

is there a way i can have this as a measure for a table visualisation?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors