Forum Discussion

Wael03's avatar
Wael03
Helper I
3 years ago
Solved

Measure calculation

Hello,

I have a column with the name of a company the number of transaction and the percentage : 

 

I would like to calculate the sum of the transaction for a company + the same number * the percentage. Here is what I have but it doesn't work : 

 

Total 3DS = CALCULATE(SUM('autor ecom'[Auth Tran Count]), 'autor ecom'[3ds indicator] = "3DS") + CALCULATE(SUM('autor ecom'[Auth Tran Count]), 'autor ecom'[3ds indicator] = "3DS") * SELECTEDVALUE('autor ecom'[Abandonment])

If you need more info tell me.

Thank you ! 
  • measure = 
    var total = sum(transactions)
    var abandoned = sumx(transactions * abandoned%)
    return
    total + abandoned


    .....something like that?  (you'll still have to add the filter conditions etc)

4 Replies

  • kpost's avatar
    kpost
    Solution Sage

    Typically when you see totals not adding up correctly like this and they involve multiplying columns and percentages and row level calculations etc, you need to experiment with SUMMARIZE and/or SUMX 

  • The thing is that the total of transactions per company is good but I don't know what code to write to tell that I want to multiply it by the column abandonment that correspond to the right company

    • kpost's avatar
      kpost
      Solution Sage

      measure = 
      var total = sum(transactions)
      var abandoned = sumx(transactions * abandoned%)
      return
      total + abandoned


      .....something like that?  (you'll still have to add the filter conditions etc)