cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
S_Coimbra
Helper I
Helper I

Client Purchase Frequency

Hi dear community,

I have a problem here and would love your help.


I have two tables. A customer table and a sales table.

Ex Customer:

Clinet IDCreation Date
101/01/2021
201/02/2021
301/03/2021


Sales:

Sales ID      Client     IDDate
1101/04/2021
2201/04/2021
3201/04/2021


Pretended result: Barchart with two filters: client creation date and sale date
customers without purchases: 1
customers with 1 purchase: 1
customers with 2 or more purchases: 1

Thank you very much,
Simao

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@S_Coimbra , Create measures like

 

Total sales = Count(Sales[Sales ID])

 

No purchase = countx(values(Customer[client ID]) , if(isblank([Total Sales]),[client ID],blank()))

 

1 purchase = countx(values(Customer[client ID]) , if([Total Sales]=1,[client ID],blank()))

 

2 or more purchase = countx(values(Customer[client ID]) , if([Total Sales]>=2,[client ID],blank()))

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@S_Coimbra , Create measures like

 

Total sales = Count(Sales[Sales ID])

 

No purchase = countx(values(Customer[client ID]) , if(isblank([Total Sales]),[client ID],blank()))

 

1 purchase = countx(values(Customer[client ID]) , if([Total Sales]=1,[client ID],blank()))

 

2 or more purchase = countx(values(Customer[client ID]) , if([Total Sales]>=2,[client ID],blank()))

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

Thank you very much.

It worked perfectly!

Cheers,

Simão

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors
Top Kudoed Authors