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

Filter SO contact by campaign list

I have a campaign list with ( startdate,enddate,shopname) in the campaign table. 

I need to filter the order contacts list fulfill all the campaigns in the list.

Any idea how to use the table list as the filter criteria?

 

 

3 REPLIES 3
samdthompson
Memorable Member
Memorable Member

have you related your campaign list with your campaign table?

// if this is a solution please mark as such. Kudos always appreciated.

No campaign list relationship,

maybe I need to show the scenariao in details and examples.

The dataset1 (SO with contact ID) 

Order IDDateContact IDShop
A00011/1/2015A001
A00026/1/2013B001
A00036/10/2014D001
A00045/19/2013A002
A00057/1/2012B002
A00064/1/2015C004
A00075/30/2015C005
A00084/16/2012E003
A00095/17/2016E003
A00106/16/2014E003
A00117/2/2013F002

 

Filter Criteria is in a DataSet (Campaign List)

Shop NoShop nameFromTo
00116/1/20126/30/2012
00227/1/20137/31/2013
00336/1/20136/30/2013
00117/1/20127/31/2012
00228/1/20138/31/2013
00337/1/20137/31/2013

 

we need to use the campaign list as the SO filter criteria to filter out the so contact list. so the expected result should be

B

F

 

 

@ericleung

 

In this scenario, you can merge these two tables in Query Editor and then using DAX formula to judge if the date in SO table is in the scope of dates marked in Compaign List. Please refer to following steps.

 

  1. Select “SO with contact ID” in Query Editor and click ‘Merge Queries’ in the top right corner. Select ‘Campaign List’ table and matching columns to create a merged table. Expand the ‘NewColumn’ as below.
    147.jpg
  2. Create a column in “SO with contact ID” to judge if the date is in the scope of dates between From and To.
    Filter_Mark = 
    IF (
        'SO with contact ID'[Shop] = 'SO with contact ID'[NewColumn.Shop No],
        IF (
            'SO with contact ID'[Date] >= 'SO with contact ID'[NewColumn.From]
                && 'SO with contact ID'[Date] <= 'SO with contact ID'[NewColumn.To],
            TRUE (),
            FALSE ()
        ),
        FALSE ()
    )
    
  3. Create a measure to display the expected results.
    Filter_Result = 
    CONCATENATEX (
        FILTER ( VALUES ( 'SO with contact ID' ), 'SO with contact ID'[Filter_Mark] = TRUE () ),
        'SO with contact ID'[Contact ID],
        ", "
    )
    
  4. Drag a Card chart into your canvas to show the results.
    47.jpg

 

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.