Forum Discussion

MIkkelHyldig's avatar
MIkkelHyldig
Icon for Helper II rankHelper II
5 years ago
Solved

SUM identical values across columns

Hi,

I have a table like where I need to sum across the table on the same ID.

My result should look like this looking at the ID column: 

ID1 0 amount (sum of 200 and -200)
ID2 -200 amount
ID3 200 amount

 Using this table:

AmountIDIDVendorDate
20012September
-20021October
-10023-
-20023-
-10032-
    

 

 

 

  • Hi Anonymous 

    The measure returns a result which sums to many rows. 

    I created a two new tables with sum for ID and sum for VendorID and the related to the original table. 

    Cheers,
    Mikkel

4 Replies

    • MIkkelHyldig's avatar
      MIkkelHyldig
      Icon for Helper II rankHelper II

      amitchandak 
      It looks like the calculated column doesn't sum across both column ID and column IDVendor? It gives me a strange result

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi MIkkelHyldig ,

         

        Try this

        Measure = CALCULATE(SUM('Table'[Amount]),ALLEXCEPT('Table','Table'[ID],'Table'[IDVendor]))
         
         

         

        Best Regards,

        Stephen Tao

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.