Forum Discussion

Giada90's avatar
Giada90
Icon for Helper IV rankHelper IV
2 years ago
Solved

calculation with aggregated and not aggregated fields

Hi, I have an excel like this:     I need to calcolate the margin for each person and I need to make sales - sum(costs), the result must me something like this:       How can I ca...
  • bhanu_gautam's avatar
    bhanu_gautam
    2 years ago

    Giada90 , I created calculated colmn using

     

    TotalCost =
    CALCULATE(
        SUM('Table'[Cost]),
        ALLEXCEPT('Table', 'Table'[Person])
    )
     
    And one for subtraction 
     
    Margin = 'Table'[Sales]-'Table'[TotalCost]
     
    Please find the attached PBIX