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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
McFLY
Regular Visitor

how to only show the earliest orderdate in this case

I need some help on this please.

I used a measure called firstOrderDate to calculate the very first order date for each customer it works fine in the first table visual but when I add orderdate column into the second table visual how can I still only show the earliest date and leave the other dates blank for each customer? Thanks.

 

firstOrderDate = CALCULATE(MIN(FactSales[OrderDate]), ALLEXCEPT(DimCustomer, DimCustomer[FullName]))
 
1.JPG

 

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

HI @McFLY

 

Try this measure
 

 

First Order Date =
VAR a =
    CALCULATE (
        MIN ( FactSales[OrderDate] ),
        FILTER (
            ALL ( DimCustomer ),
            DimCustomer[FullName]
                = MAX ( DimCustomer[FullName] )
        )
    )
RETURN
    IF (
        MAX ( FactSales[OrderDate] ) = a,
        a,
        BLANK ()
    )

 


Regards,

Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

[First Order Date] =
IF( HASONEVALUE( DimCustomer[FullName] ),
	CALCULATE(
		MIN( FactSales[OrderDate] ),
		ALL( FactSales ),
		VALUES( DimCustomer[FullName] )
	)
)

This code will return the very first order date for any single customer regardless of any other filters that might have been put on any tables.

 

Best

D

harshnathani
Community Champion
Community Champion

HI @McFLY

 

Try this measure
 

 

First Order Date =
VAR a =
    CALCULATE (
        MIN ( FactSales[OrderDate] ),
        FILTER (
            ALL ( DimCustomer ),
            DimCustomer[FullName]
                = MAX ( DimCustomer[FullName] )
        )
    )
RETURN
    IF (
        MAX ( FactSales[OrderDate] ) = a,
        a,
        BLANK ()
    )

 


Regards,

Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

Thank you @harshnathani for your solution.

Hi @McFLY ,

 

If this solution helps, please mark it as Solved.

 

Will help others in the community.

 

Thanks

Harsh Nathani

vivran22
Community Champion
Community Champion

Hello @McFLY 

 

What do you mean by leave oter dates blank for each customer? Can you show the sample expected results?

 

Cheers!
Vivek

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

Thank you for your reply.

 

I mean the third column firstOrderDate in second table I want to always show the earliest date for each customer only.

 

For example:

Aaron Collins  2011/1/25 0:00:00  2011/1/25 0:00:00

Aaron Collins 2013/11/16 0:00:00  blank

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.