Forum Discussion

primolee's avatar
primolee
Helper V
5 years ago
Solved

Change different multiplier when different date

Hello everyone,

 

I have advertisement spending data of each media Type in the following table.

MediaDateSpending
Outdoor2018/9/1100000
Cable TV2020/1/120000
Newspaper2017/7/130000
Terr2019/8/160000
Radio2018/8/170000
Magazine2018/6/150000
Outdoor2016/12/140000
Cable2020/6/1120000
Newspaper2020/12/180000
Terr.2021/6/1160000
Radio2020/5/120000
Magazine2019/3/140000

 

Because each kind of media has different weight at different period, here is my other table with weight information

Media NameStart DateEnd DateWeight
Outdoor2018/9/12021/6/300.8
Cable2018/9/12021/6/300.068
Newspaper2018/9/12021/6/300.326
Terr.2018/9/12021/6/300.055
Radio2018/9/12021/6/300.217
Magazine2018/9/12021/6/300.631
Outdoor2016/1/12018/8/310.7
Cable2016/1/12018/8/310.06
Newspaper2016/1/12018/8/310.4
Terr.2016/1/12018/8/310.08
Radio2016/1/12018/8/310.3
Magazine2016/1/12018/8/310.65

 

What I want to do is to calculcate the weighted spending using the correct weight depending the date column.

 

For example, media and date of first row of spending data is outdoor 2018/9/1, and weight of outdoor between 2018/9/1 and 2021/6/30 is 0.8, therefore the weighted spending is 80000.

 

Whereas for the third row newspaper, because the date 2017/7/1 is between 2016/1/1 and 2018/8/31, therefore the weight is 0.4.

 

Following is what I hope to accomplish in a BI table visual.

MediaDateSpendingWeightWeighted Spending
Outdoor2018/9/11000000.880000
Cable2020/1/1200000.0681360
Newspaper2017/7/1300000.412000

 

I want to add the "Weight" column to the first table.  Could someone please help me on doing this?

 

Thank you very much for your help.

 

Best regards,

David

4 Replies

  • Hi, primolee 

    Please check the below picture and the sample pbix file's link dow below.

    I created both measures and columns.

    All measures and created columns are in the sample pbix file.

     

     

    https://www.dropbox.com/s/5bhb72jux254dxl/primolee2.pbix?dl=0 

     

    Hi, My name is Jihwan Kim.

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

    Linkedin: https://www.linkedin.com/in/jihwankim1975/

    • primolee's avatar
      primolee
      Helper V

      Hello Jihwan_Kim ,

       

      Thank you again for your help.  Greatly appreciated!

       

      To further extend the question.  Because we have different weight values for different people, is it possible to have a filter visual in the report, choose a person's weight setting, then calculate the weighted spending?

       

      In this case, I have 1 more column as Name, just as John and Peter, and each of them have their weight setting.  Then make a name filter in the report.

       

      Thank you very much.

       

      Best regards,

      David