Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

sum of separate code

amountaccount code  account code 
101  115
52result-> 210
307  730
51    
52    

 

Create 3 different measurements in order to create a sum for each distinct account code

measure for account code 1

for account cod2

account code 7

  • Hi Anonymous 

    You may create the measures like below:

    Measure 1 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=1)
    Measure 2 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=2)
    Measure 3 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=7)

    Regards,

5 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Anonymous 

       

      thanks, i can explain why, but i need 3 different measure each for every account code

       

      basically ive create a measure [calculus] that calculate all total for all account code and now I need to filter this measure for each specific account code

       

      I can filter through slicer or other but I need to create a measure that filter for each account so in this case 3 different measure

    • Anonymous's avatar
      Anonymous
      Not applicable

      or use this:

       

      Sum =
      CALCULATE (
      SUMX(table1, Table1[amount] ),ALLEXCEPT(Table1,Table1[account code])
      )
  • Why don't you use Matrix visualization i think it will give you the same result.

  • v-cherch-msft's avatar
    v-cherch-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous 

    You may create the measures like below:

    Measure 1 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=1)
    Measure 2 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=2)
    Measure 3 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=7)

    Regards,