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
hcr4
Frequent Visitor

First sale date per particular product per customer

I have two tables - Customer and Product. Customer table has a FirstSaleDate column showing the first time a sale was made to a particular customer regardless of the product and Product has FirstProductSale showing the first time a particular product was sold regardless of the customer. I want to create a measure that will provide me with a field (ideally in the Product table) showing when a customer first bought a particular product.

 

My DAX skills are lacklustre and I'm not sure where to begin. Appreciate any help, thanks.

 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @hcr4 

 

I briefly simulated some data that I hope will fit your situation.

Column:

first bought = 
LOOKUPVALUE (
    Customer[FirstSaleDate],
    'Product'[FirstProductSale], [FirstProductSale]
)

vzhangti_0-1648795914364.png

 

Measure:

first bought M = 
LOOKUPVALUE (
    Customer[FirstSaleDate],
    'Product'[FirstProductSale], SELECTEDVALUE('Product'[FirstProductSale])
)

vzhangti_1-1648795956957.png

LOOKUPVALUE: https://docs.microsoft.com/dax/lookupvalue-function-dax 

Please see the attachment for details.

 

Best Regards,

Community Support Team _Charlotte

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
v-zhangti
Community Support
Community Support

Hi, @hcr4 

 

I briefly simulated some data that I hope will fit your situation.

Column:

first bought = 
LOOKUPVALUE (
    Customer[FirstSaleDate],
    'Product'[FirstProductSale], [FirstProductSale]
)

vzhangti_0-1648795914364.png

 

Measure:

first bought M = 
LOOKUPVALUE (
    Customer[FirstSaleDate],
    'Product'[FirstProductSale], SELECTEDVALUE('Product'[FirstProductSale])
)

vzhangti_1-1648795956957.png

LOOKUPVALUE: https://docs.microsoft.com/dax/lookupvalue-function-dax 

Please see the attachment for details.

 

Best Regards,

Community Support Team _Charlotte

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

v-zhangti
Community Support
Community Support

Hi, @hcr4 

 

Can you provide some of the example data? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures. 

 

Best Regards

johnt75
Super User
Super User

Try MINX( 'Order Lines', RELATED(Orders[Order date])

johnt75
Super User
Super User

If you also have a Sales table linked to both Product and Customer then MIN(Sales[Order date]) will give the first time a product was ordered. You can put that measure in a table with a Customer and a Product and it will show the first order for that product by that customer

hcr4
Frequent Visitor

Hi, thanks for the reply. The Customer and Product tables are 'linked' via Orders and Order Lines tables. I.e. Product <--> Order Lines <--> Orders <--> Customers

So in this case I don't think this works. 

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.