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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
etane
Resolver I
Resolver I

Customer who bought A not B During Different Time Periods

Hello.

 

I am trying to recreate this chart in PBI:

etane_0-1751053059614.png

Trying to count number of customers who has purchased Product A not B, B not A and customers who purchased both A and B during current and previous rolling 12 months.

 

Please help me construct this.  Attached is my work in progress using sample data:

Link

 

Thanks.  

Regarding the WIP file, I've attempted to create measures that allow me to isolate customers who purchased A but not B during a 12 month period.  Somehow, it doesn't seem accurate and it doesn't allow me to count the number of customers.  

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to recreate the page like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1751178420004.png

 

 

Jihwan_Kim_0-1751178405577.png

 

INTERSECT function (DAX) - DAX | Microsoft Learn

EXCEPT function (DAX) - DAX | Microsoft Learn

Create calculation groups in Power BI - Power BI | Microsoft Learn

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to recreate the page like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1751178420004.png

 

 

Jihwan_Kim_0-1751178405577.png

 

INTERSECT function (DAX) - DAX | Microsoft Learn

EXCEPT function (DAX) - DAX | Microsoft Learn

Create calculation groups in Power BI - Power BI | Microsoft Learn

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

@Jihwan_Kim   Thanks!  This works well.

lbendlin
Super User
Super User

lbendlin_0-1751075218091.png

 

@lbendlin Thanks!  Exactly what I was looking for.  

 

In one of the measures, you typed "A or B" but I am sure you meant "A and B"?

Can you please add a measure that sums up units sold for customers who purchased both A and B?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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