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
gng
Frequent Visitor

How to identify 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
gng
Frequent Visitor

Found the solution:

 

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

 

Thanks for your reply! 

View solution in original post

2 REPLIES 2
gng
Frequent Visitor

Found the solution:

 

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

 

Thanks for your reply! 

assuming you have loaded a customer table, products table and sales table, you could write this measure

 

count of cust not purchasing =
CALCULATE (
    COUNTROWS ( customers ),
    FILTER ( customers, CALCULATE ( SUM ( sales[sales] ) ) = 0 )
)

 put product code onto rows in a table and add this measure.

 

Or put customers on rows and products on columns and this measure will show you the intersection of missing sales



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.