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
amiller5
Helper II
Helper II

Dividing measure between 2 tables

I need help with a measure that divides the quarterly category spend over the count of category leads for the quarter. I have attached a simplified version of the data. There are more categories.

 

The formula works, it is just not flowing correctly based on the date that I bring in, whether from the date table, the marketing spend table, or sales 5 data.

@Ashish_Mathur 

https://intellimed-my.sharepoint.com/:u:/p/amiller/EXlAUxRhfshBnclo7Kt4dWMBHAmefEbrgzhfOUBg-AcGGw?e=... 

1 ACCEPTED SOLUTION
grantsamborn
Solution Sage
Solution Sage

Try this.

1. Calculated Column on 'Marketing Spend'

 

 

Qtr Date = 
SWITCH(
    [Quarter],
    "Q1", DATE([Year], 1, 1),
    "Q2", DATE([Year], 4, 1),
    "Q3", DATE([Year], 7, 1),
    "Q4", DATE([Year], 10, 1)
)

 

2. Create a many-to-one relationship between 'Marketing Spend'[Qtr Date] and 'Date'[Date].

3. Remove relationship between 'Sales 5' and 'Marketing Spend'.

4. Change [Total cost/lead] to:

 

 

Total cost/lead = DIVIDE( [Total source spend], [Count of leads], 0)

 

 

pbix : https://1drv.ms/u/s!AnF6rI36HAVkhPFD-hl8t89A9eDi1g?e=2NPEpW

 

Hope this helps.

View solution in original post

2 REPLIES 2
grantsamborn
Solution Sage
Solution Sage

Try this.

1. Calculated Column on 'Marketing Spend'

 

 

Qtr Date = 
SWITCH(
    [Quarter],
    "Q1", DATE([Year], 1, 1),
    "Q2", DATE([Year], 4, 1),
    "Q3", DATE([Year], 7, 1),
    "Q4", DATE([Year], 10, 1)
)

 

2. Create a many-to-one relationship between 'Marketing Spend'[Qtr Date] and 'Date'[Date].

3. Remove relationship between 'Sales 5' and 'Marketing Spend'.

4. Change [Total cost/lead] to:

 

 

Total cost/lead = DIVIDE( [Total source spend], [Count of leads], 0)

 

 

pbix : https://1drv.ms/u/s!AnF6rI36HAVkhPFD-hl8t89A9eDi1g?e=2NPEpW

 

Hope this helps.

Not sure why but I had to use the Lead source and cateogyr from the Sheet 2 or key in the Spend/Lead. But the measure is calculating correctly! 

Thanks!

 

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.