cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

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

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
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!!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


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. 

Microsoft v-kelly-msft
Microsoft

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

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

Microsoft v-kelly-msft
Microsoft

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

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
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors