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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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