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
Anonymous
Not applicable

List of customers with no orders, based on a slicer

I have a list of customers, who have to make a purchase every time there is a new campaign.

 

Also, I have data that describes the purchases and who made them.

 

The task is to provide a list of customers, who have not made a purchase. This list has to change in line with a campaign slicer. In other words, I have to provide a list of customers, who have not made a purchase for every campaign conducted.

 

Any ideas on how to implement this?

 

2 ACCEPTED SOLUTIONS

Hi @Anonymous ,

 

v-lionel-msft_0-1601874443202.png

Please do like this.

1. Delete the relationship.

v-lionel-msft_1-1601874479328.png

2. Create a measure.

Measure = 
VAR x = 
CALCULATE(
    MAX(Purchases[Campaign]),
    FILTER(
        Purchases,
        Purchases[Countries] = MAX(Countries[Countries])
    )
)
RETURN
IF(
    x = BLANK(),
    "No purchases",
    x
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable
6 REPLIES 6
Anonymous
Not applicable

(Customers are changed to countries here)

Just to reiterate, I have to compare the column Countries from Purchases table to the complete list of countries in Countries table. I have to do it by campaigns. For instance, for campaign "1" nothing has to be provided, as there are purchases for all of the countries. However, campaign "2" has missing countries, and consequently, the list of them has to be displayed.

I have many campaigns in the data, the same logic has to be applied to all of them.

I see it as two visuals:
1) a slicer, based on campaigns
2) a table, that has a list of countries with no purchases, which changes every time the slicer is changed.

Anonymous
Not applicable

Hi @Anonymous ,

 

v-lionel-msft_0-1601874443202.png

Please do like this.

1. Delete the relationship.

v-lionel-msft_1-1601874479328.png

2. Create a measure.

Measure = 
VAR x = 
CALCULATE(
    MAX(Purchases[Campaign]),
    FILTER(
        Purchases,
        Purchases[Countries] = MAX(Countries[Countries])
    )
)
RETURN
IF(
    x = BLANK(),
    "No purchases",
    x
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

amitchandak
Super User
Super User

@Anonymous , You have do try something like this

 

if(isblank[sales], customer[ID],blank())

or

countx(values(customer[ID]),if(isblank[sales], customer[ID],blank()))

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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.