cancel
Showing results for
Did you mean:
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 ID Creation Date 1 01/01/2021 2 01/02/2021 3 01/03/2021

Sales:

 Sales ID Client     ID Date 1 1 01/04/2021 2 2 01/04/2021 3 2 01/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
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()))

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!
2 REPLIES 2
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()))

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!
Helper I

Thank you very much.

It worked perfectly!

Cheers,

Simão

Announcements