Forum Discussion
First vs Second purchase Products
- Anonymous4 years ago
Hi jmukhtar ,
I have created a data sample,
According to this requirement: we are looking for a list of customers who have bought a specific product in first order and then use that list to see what these customers have bought in second order
Please follow these steps:
1. Create a productId table for slicer
ForSlicer = VALUES('Table'[ProducrId])2. Rank by Date
Rank = RANKX (ALL('Table'), CALCULATE ( MAX ( ( 'Table'[Date]) ) ),,ASC,Dense)3. First flag measure , and apply it to filter pane, set as "is 1"
First = IF(MAX('Table'[ProducrId]) in ALLSELECTED(ForSlicer[ProducrId]),[Rank],BLANK())4. Second flag measure, and apply it to filter pane, set as "is 1" as well
Second = var _allCustomers=SUMMARIZE(FILTER(ALL('Table'),[First]=1),[CustomerID]) return IF(MAX('Table'[CustomerID]) in _allCustomers && [Rank]=2,1,0)Outputs:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
In that case you can add this table:
Then you can use that in a table to get the list of customers who bought e.g. Product C in first order:
(add this to table visual ^^)
Now edit interactions to disable product filter from second visual:
Filter second visual with "second"
And as a result we notice that customers A and B bought product C in the first order. Out of these customers A bought product D in second order.
Data matches this:
- jmukhtar4 years agoRegular Visitor
Hi ValtteriN
This solution gives us the first vs the second purchase, but What we want to get in second order visual is only the customers who have purchased from the selected category in first order. Please see the snapshot
1,3,6,8,9,10 customers bought product A in first order; and these customers bought product B, C and D in second order.
In second visual we want to see products bought by customers who have bought product A in first order