Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

@Anonymous , 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()))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , 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()))

Anonymous
Not applicable

Thank you very much.

It worked perfectly!

Cheers,

Simão

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.