Forum Discussion

ibodnar's avatar
ibodnar
New Member
9 years ago

Calculating aggregates in table

Hi everyone, 

 

I'd like to create a new column that shows the total sales of each country in the corresponding row (see the last column in the table). Can you help me which function(s) should I use? 

 

CountrySalesSales Over Country
US1065
US2565
US3065
Germany2035
Germany1535

2 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    ibodnar wrote:

    Hi everyone, 

     

    I'd like to create a new column that shows the total sales of each country in the corresponding row (see the last column in the table). Can you help me which function(s) should I use? 

     

    Country Sales Sales Over Country
    US 10 65
    US 25 65
    US 30 65
    Germany 20 35
    Germany 15 35

    You can try

    Sales Over Country =
    CALCULATE ( SUM ( 'Table'[Sales] ), ALLEXCEPT ( 'Table', 'Table'[Country] ) )