Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
hi , I have 9 PUrchased Customers , by Filter MEP , and i have total Customers are 94 for MEP ,
I have Delivery Date of customer who purchase the order by customer code and customer name with the QTY as well as the 2nd table,
My purpose is to see , who is the Re-Purchased Customer By N Days ?
For example : Customer Lach Sophea purchased on Dec 4 and Dec 5 , he's a Re-Purchased Customer . because he purchased twice during 2 days.
Let say , i use Parameter for N Day ( 7 Days ) , During these 7 Days , Is Lach Sopheak Still Purchase any day for twice or more than this ? if it's more than 1 time purchase during these 7 days , He's A Re-Purchased Customer , But during these 7 days if he purchases only 1 time , he's not Re-PUrchased Customers.
My purpose is to see how many Re-Purchased Customers by N Days
Solved! Go to Solution.
Hi @Chanleakna123,
Please refer to below measures:
pur datediff = VAR currentpurchase = SELECTEDVALUE ( Tab_2[Delivery Date] ) VAR nextpurchase = CALCULATE ( MIN ( Tab_2[Delivery Date] ), FILTER ( ALLEXCEPT ( Tab_2, Tab_2[Customer Code] ), Tab_2[Delivery Date] > currentpurchase ) ) RETURN DATEDIFF ( currentpurchase, nextpurchase, DAY ) min datediff = MINX ( FILTER ( ALLSELECTED ( Tab_2 ), Tab_2[Customer Code] = SELECTEDVALUE ( Tab_2[Customer Code] ) ), [pur datediff] ) is in NDay = IF ( [pur datediff] <> BLANK (), IF ( [min datediff] <= NDay[NDay Value], "Y", "N" ), BLANK () ) count re-purchased = CALCULATE ( DISTINCTCOUNT ( Tab_2[Customer Code] ), FILTER ( ALLSELECTED ( Tab_2 ), Tab_2[is in NDay] = "Y" ) )
Best regards,
Yuliana Gu
Hi @Chanleakna123,
Please refer to below measures:
pur datediff = VAR currentpurchase = SELECTEDVALUE ( Tab_2[Delivery Date] ) VAR nextpurchase = CALCULATE ( MIN ( Tab_2[Delivery Date] ), FILTER ( ALLEXCEPT ( Tab_2, Tab_2[Customer Code] ), Tab_2[Delivery Date] > currentpurchase ) ) RETURN DATEDIFF ( currentpurchase, nextpurchase, DAY ) min datediff = MINX ( FILTER ( ALLSELECTED ( Tab_2 ), Tab_2[Customer Code] = SELECTEDVALUE ( Tab_2[Customer Code] ) ), [pur datediff] ) is in NDay = IF ( [pur datediff] <> BLANK (), IF ( [min datediff] <= NDay[NDay Value], "Y", "N" ), BLANK () ) count re-purchased = CALCULATE ( DISTINCTCOUNT ( Tab_2[Customer Code] ), FILTER ( ALLSELECTED ( Tab_2 ), Tab_2[is in NDay] = "Y" ) )
Best regards,
Yuliana Gu
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
65 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |