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

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.

Reply
Chanleakna123
Post Prodigy
Post Prodigy

Count Repuchased only 1 If customers purchased different products at the same date

hi all , 

 

i have acheived 60% calculation of Purchased and RePurchased based on below calculation : 

 

**Measure 1 = IF(SELECTEDVALUE('Fuze and Energy'[Date])>=MIN(Query1[Date])&&SELECTEDVALUE(Query1[Date])<=MAX(Query1[Date])&&SELECTEDVALUE('Fuze and Energy'[Value])>0,1,0)
**Customer Purchased = CALCULATE(DISTINCTCOUNT('Fuze and Energy'[Customer Name - Store[Customer]] host code]),FILTER('Fuze and Energy',[Measure 1]>0))
**Measure 2 = SUMX(ALLEXCEPT('Fuze and Energy','Fuze and Energy'[Customer Name - Store[Customer]] host code]),[Measure 1])
**Customer RePurchased = CALCULATE(DISTINCTCOUNT('Fuze and Energy'[Customer Name - Store[Customer]] host code]),FILTER('Fuze and Energy',[Measure 2]>1))
 

now the result is not as expected yet ,  when i filter on date , Customer : 18 TMEY purchased 2 flavors at the same date and resulted Count as RePurchased , This is not right .

If customers purchased different flavor at the same time , we Don't count as REPURCHASED Customer . this is PURCHASED Customer . REPURCHASED Customer = 0 

1.JPG

1 ACCEPTED SOLUTION

@v-kelly-msft SO BRILLIANT, THANKS YOU SO MUCH

View solution in original post

6 REPLIES 6
v-kelly-msft
Community Support
Community Support

Hi @Chanleakna123 ,

 

Your measures need to be corrected as below:

Measure = var a = CALCULATE(COUNTROWS('Fuze and Energy'),FILTER(ALLSELECTED('Fuze and Energy'),'Fuze and Energy'[Date]<=MAX('Fuze and Energy'[Date])),VALUES('data'[Customer Name - Store[Customer]]]),VALUES('Fuze and Energy'[Flavour.]))
return
IF(a=BLANK(),BLANK(), IF(a>=2,1,0))
Repurchased count = CALCULATE(DISTINCTCOUNT('Fuze and Energy'[Customer Name - Store[Customer]]]),FILTER('Fuze and Energy',[Measure]=1))+0
Measure 1 = IF(SELECTEDVALUE('Fuze and Energy'[Date])>=MIN(Query1[Date])&&SELECTEDVALUE(Query1[Date])<=MAX(Query1[Date])&&SELECTEDVALUE('Fuze and Energy'[Value])>0,1,0)

For the related .pbix file,pls click here.

 

Best Regards,

Kelly

@v-kelly-msft SO BRILLIANT, THANKS YOU SO MUCH

Hi @Chanleakna123

 

It's pleasant that your problem has been solved, could you please mark the reply as Answered?

 

Best Regards,

Kelly

@v-kelly-msft , hi dear.

when i filter on Brand and flavor and date , All are not syncronized , looks like i do some faulthy on sth. 

can you please help me ? 

 

https://www.dropbox.com/s/dpm5ahvx2gytfjj/WS%20Primary%20V2.pbix?dl=0

 

amitchandak
Super User
Super User

If possible please share a sample pbix file after removing sensitive information.Thanks.

My Recent Blog -

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

hi @amitchandak 

 

https://www.dropbox.com/s/4wdbd7u67rsqo8g/Testing.pbix?dl=0

 

above is the link on dropbox i shared , please help me on this , appreciated. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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