Forum Discussion

spud's avatar
spud
Regular Visitor
8 years ago

first product ordered

 I would like your help:

 

short hypothetical example

 

a vendor sells the following items:

cherries code 283

apples   code 282

oranges code 111

 

A customer orders cherries and apples all of the time

 

Suddenly the customer orders oranges- how could you set something up to find if a customer ordered a new item such as oranges

 

1 Reply

  • spud I assumed there is order date in the data, add following column to identify when product was ordered first time.

     

    Is this first order = 
    VAR __itemsOrders = CALCULATETABLE( VALUES( Table3[Product] ), FILTER( ALL( Table3 ), Table3[OrderDate] < EARLIER( Table3[OrderDate] ) ) )
    RETURN
    IF( NOT Table3[Product]  IN __itemsOrders, "Yes" )