cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted
Post Prodigy
Post Prodigy

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

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

View solution in original post

6 REPLIES 6
Highlighted
Super User IV
Super User IV

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

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...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Post Prodigy
Post Prodigy

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

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. 

Highlighted
Community Support
Community Support

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

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

Highlighted
Post Prodigy
Post Prodigy

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

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

View solution in original post

Highlighted
Community Support
Community Support

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

Hi @Chanleakna123

 

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

 

Best Regards,

Kelly

Highlighted
Post Prodigy
Post Prodigy

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

@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

 

Helpful resources

Announcements
Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors