cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gng
Frequent Visitor

Customers who have NOT bought a product

Hello! I am trying to build this report where I have to identify customers who have NOT bought a particular product but has bought other products.

I have attached an example spreadsheet which Customer, Item and Sales tables. Objective is to dynamically select an item from a slicer and the resulting table should give Customers who have NOT bought that item with a Total Sales Amount (from other products) in descending order.

 

 

ExampleProblem.PNG

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Re: Customers who have NOT bought a product

Hi @gng,

 

If I understand you correctly, you should be able to use the formula below to create a new measure, then show it on a Table visual with Sales[Customer ID] column on the report to get your expected result.

Measure =
IF (
    HASONEVALUE ( Items[Item] ),
    CALCULATE (
        SUM ( Sales[Sales] ),
        FILTER (
            Sales,
            NOT ( CONTAINS ( Sales, Sales[Item], VALUES ( Items[Item] ) ) )
        )
    ),
    SUM ( Sales[Sales] )
)

Note: make sure there is no any relationship between the Item table and Sales table.

r2.PNG

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

View solution in original post

4 REPLIES 4
Microsoft
Microsoft

Re: Customers who have NOT bought a product

Hi @gng,

 

If I understand you correctly, you should be able to use the formula below to create a new measure, then show it on a Table visual with Sales[Customer ID] column on the report to get your expected result.

Measure =
IF (
    HASONEVALUE ( Items[Item] ),
    CALCULATE (
        SUM ( Sales[Sales] ),
        FILTER (
            Sales,
            NOT ( CONTAINS ( Sales, Sales[Item], VALUES ( Items[Item] ) ) )
        )
    ),
    SUM ( Sales[Sales] )
)

Note: make sure there is no any relationship between the Item table and Sales table.

r2.PNG

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

View solution in original post

gng
Frequent Visitor

Re: Customers who have NOT bought a product

Hi @v-ljerr-msft 

 

This solution works great. I really appreciate your help and time.

 

Regards

gng
Frequent Visitor

Re: Customers who have NOT bought a product

Hi @v-ljerr-msft,

 

With your help, I am able to get Sales Amount for a customer who didnt order a specific product. Is there a way to calculate Sales for specific product(s) for a customer who didnt order another specific product?

 

In this example, show only those customers who bought either "x" or "w" but not "v".

 

Thanks for your time and help!

Asantos2020 Advocate II
Advocate II

Re: Customers who have NOT bought a product

Hello @v-ljerr-msft ,

 

How would I include a date slicer, which when selected, customers who didin't buy the selected product within that period showed up in the list?

 

Thank you!

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors