Forum Discussion
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.
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.
2 Replies
- grantsamborn
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.
- amiller5
Helper II
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!