Forum Discussion

amiller5's avatar
amiller5
Icon for Helper II rankHelper II
4 years ago
Solved

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=FFn2Q4 

  • 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

  • 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's avatar
      amiller5
      Icon for Helper II rankHelper 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!