cancel
Showing results for
Did you mean:
Highlighted
Member

## 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 ACCEPTED SOLUTION

Accepted Solutions
Member

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

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

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

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

Member

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

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

Microsoft

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

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)``

Best Regards,

Kelly

Member

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

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

Microsoft

Best Regards,

Kelly

Member

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

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

Announcements

#### 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!

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?

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