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
gracejoshi
New Member

Basket analysis - basket with same product category (more than 1)

Hello everyone,

 

I have seen the usual pattern for Basket analysis (https://www.daxpatterns.com/basket-analysis/). And I am using the similar data model.   

Capture.JPG

 

Here is what I want :

When I select "Dishwasher" product category from [Product] table and [Filter Product], Only 1 transaction should qualify as [Basket with Both Products] i.e transation ID "xxx123".  At the moment with my current formula, I am getting 3 transactions intead of 1. Basically, if a basket contains same product more than once, that I want that to qualify and want to ignore other transaction where it exist just once.

 

 Capture.JPG

Here is my formula :

Capture_formula.JPG

Here is how my result look like:

Capture_pbi.JPG

I did look at https://www.daxpatterns.com/basket-analysis/ post for excluding Same product selection. But that excludes even my "xxx123" transaction. and gives me blank if the same product is selected in Product and Filter Product table.

 

Would really appreciate any help.

Thanks

 

 

 

 

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @gracejoshi 

 

Try adding the below as an extra argument to your CALCULATETABLE statement.

FILTER( Sales, Sales[ProductCount] > 1 ) 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Hi @Mariusz 

If i apply this condition, i am getting no value for other transactions.

Capture1.JPG

It should be like the following  (except against the fridge category it should show 0)

Capture2.JPG

Here is my transactions for fridges :

Capture3.JPG

 

I would want to attach my pbix file , dont know how to do that. That would have been useful to understand the scenario.

 

Thanks

Grace

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.

Top Solution Authors