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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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