Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

SumProduct DAX formula needed

Hi Team,

 

I need help on creating SumProdut same as excel

 

Table1

 

DateEURUSDGBPTotal
6/1/20170.00-17375965.8124889.80-17343852.99
6/2/20170.00-17375965.8116.52-17375944.53
6/3/20170.00-17375965.8116.52-17375944.53
6/4/20170.003898944.3916.523898965.67
6/5/20171662538.331508133.9893203.453499001.66
6/6/20179427560.61432590.10398.4511054193.64
6/7/2017561163.032771843.6764267.923487159.96
6/8/2017-159730.241949435.12555.391770920.83
6/9/2017887221.942268106.63572.133261015.88
6/10/2017887221.942268106.63572.133261015.88

 

Table 2 

 

DateEURUSDGBP
6/1/20171.122511.2902
6/2/20171.127511.2881
6/3/20171.127511.2881
6/4/20171.127511.2881
6/5/20171.12511.293
6/6/20171.126611.2894
6/7/20171.126311.2958
6/8/20171.122111.2946
6/9/20171.118311.2741
6/10/20171.118311.2741

 

as for the sumproduct  in excel, it works as an array and calculates Table1.EUR * Table2.EUR and gives the result, similarly it calculate for other columns and give the sum of all the values. however, I am unable to replicate this in DAX. 

 

The output should be Table1. Total

 

Please help .

  • Anonymous there is may ways to do this, assuming these two tables are related on date with 1 to 1 relationship, you can add following column:

     

    Total = 
    (Table6[EUR] * RELATED( Table7[EUR] ) ) +
    (Table6[GBP] * RELATED( Table7[GBP] ) ) +
    (Table6[USD] * RELATED( Table7[USD] ) )

4 Replies

    • parry2k's avatar
      parry2k
      Icon for Super User rankSuper User

      Anonymous there is may ways to do this, assuming these two tables are related on date with 1 to 1 relationship, you can add following column:

       

      Total = 
      (Table6[EUR] * RELATED( Table7[EUR] ) ) +
      (Table6[GBP] * RELATED( Table7[GBP] ) ) +
      (Table6[USD] * RELATED( Table7[USD] ) )
      • Anonymous's avatar
        Anonymous
        Not applicable

        Thank you... This works


        however, do we have an exact replica of SUMPRODUCT? 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes