Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jnickell
Helper V
Helper V

Many to Many assistance or validation of approach

I'm working with data from Dynamics CRM and for now trying to relate Contacts with the campaign they interacted with, not just their source campaign.  The way our instance is getting populated I believe my best recourse is to use the lead record's 'parentContactID' to relate the Contacts  to the Lead (1 to M).  The Campaigns (one) are related to the (many) Leads by the Lead's CampaignID.  This essentially makes the Lead Table the bridge table between Campaigns and Contacts.

 

I've concocted a measure that appears to give me the number I need but I'm would like your help in knowing two things. 

  • Is this measure the appropriate way to identify number of contacts that interacted with a campaign
  • Would it be better to have a separate bridge table (essentially a subset of columns from the Lead table) instead of relying on the Lead table itself.

I've below is a subset of CRM data that I'm using to work with. as well as a screenshot of the relationships using the Leads table as the bridge table. 

 

Appreciate your assistance!

 

My Measures:

 

Campaign Contacts = 
    VAR CampaignExistence = 
        COUNTROWS(
            FILTER(
                'Contacts_v2 Inquiry',
                COUNTROWS(RELATEDTABLE('Leads_v2 Inquiry'))
            )
        )
    
    RETURN
        CampaignExistence
Campaign Leads = 
    CALCULATE(
        COUNTROWS(
            'Leads_v2 Inquiry'
        )
    )

 

2024-06-18 07_49_52-CRM Entities.png

Contacts

contactIdCreated ByCreated OnDescriptionoriginatingLeadId
1CRM Service6/9/2024 0:02Project Name: #14
2CRM Service6/3/2024 10:00Project Name: #2 
3Former Employee2/23/2018 10:44Inquiry: Hello-  #32
4CRM Service6/3/2024 10:00Project Name: #4 
5Former Employee11/30/2017 9:22  

 

Campaigns

campaignidName
1Campaign 1
2Campaign 2
3Campaign 3
4Campaign 4
5Campaign 5
6Campaign 6
7Campaign 7
8Campaign 8
9Campaign 9
10Campaign 10
11Campaign 11
12Campaign 12
13Campaign 13
14Campaign 14
15Campaign 15
16Campaign 16
17Campaign 17
18Campaign 18
19Campaign 19

 

campaignIdDescriptionFull NameleadIdparentAccountIdparentContactId
 Project Name: #1Lead 11  
 Inquiry: Hello- #1Lead 2213
18Project Name:#2Lead 33 4
18Project Name: #3Lead 44 1
 # 4Lead 55  
18Project Name: #5Lead 16 2
 #6Lead 67  
 #7Lead 78  
18Project Name: #8Lead 19 2
 Hi, #9Lead 810  

 

2024-06-18 07_58_27-CRM Entities.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jnickell 

 

1. Is this measure the appropriate way to identify number of contacts that interacted with a campaign

 

Your measurement looks correct because it tries to count the number of contacts associated with the campaign through the Leads table.

 

Of course, it is important to ensure that internal functions accurately reflect the relationship between connections and activities through cues.

 

If the relationships in the model are set up correctly, this metric should work as expected.

 

2. Would it be better to have a separate bridge table (essentially a subset of columns from the Lead table) instead of relying on the Lead table itself.

 

Using the lead table as a bridge table is a common approach in cases where there is a many-to-many relationship between two entities.

 

However, creating a separate bridge table may be helpful in the following cases:

 

You want to simplify the model by isolating many-to-many relationship logic.


The "Leads" table contains a large amount of data unrelated to the relationship between contacts and marketing activities.


Your goal is to improve the clarity or manageability of your model.

 

Given these factors, if the Lead table works well in connecting contacts and marketing activities without introducing unnecessary complexity or performance issues, then it makes sense to continue using it.

 

Regards,

Nono 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

2 REPLIES 2
Anonymous
Not applicable

Hi @jnickell 

 

1. Is this measure the appropriate way to identify number of contacts that interacted with a campaign

 

Your measurement looks correct because it tries to count the number of contacts associated with the campaign through the Leads table.

 

Of course, it is important to ensure that internal functions accurately reflect the relationship between connections and activities through cues.

 

If the relationships in the model are set up correctly, this metric should work as expected.

 

2. Would it be better to have a separate bridge table (essentially a subset of columns from the Lead table) instead of relying on the Lead table itself.

 

Using the lead table as a bridge table is a common approach in cases where there is a many-to-many relationship between two entities.

 

However, creating a separate bridge table may be helpful in the following cases:

 

You want to simplify the model by isolating many-to-many relationship logic.


The "Leads" table contains a large amount of data unrelated to the relationship between contacts and marketing activities.


Your goal is to improve the clarity or manageability of your model.

 

Given these factors, if the Lead table works well in connecting contacts and marketing activities without introducing unnecessary complexity or performance issues, then it makes sense to continue using it.

 

Regards,

Nono Chen

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

Thanks for the feedback @Anonymous 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.