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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
etane
Helper V
Helper V

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

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

@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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.