Forum Discussion

santiago01's avatar
santiago01
Frequent Visitor
7 years ago
Solved

Calculate Sum based on another column

Hello,

I have a table with projects and hours. Each project has a corresponding proposal number.

 

 

How can I create a measure that adds all the hours for the corresponsing proposal and show them along side the project hours?

 

 

I tried

Measure = CALCULATE(SUM(Table[Hours]),FILTER(ALL(Table),Table[Project_Number]=Table[Proposal_Number]))
  • santiago01 ,

     

    You can create a measure using DAX below:

    SumProjectHours = CALCULATE(SUM('Table'[Hours]), ALLEXCEPT('Table', 'Table'[Project_Number], 'Table'[Proposal Number]))
    

     

    Community Support Team _ Jimmy Tao

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

1 Reply

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    santiago01 ,

     

    You can create a measure using DAX below:

    SumProjectHours = CALCULATE(SUM('Table'[Hours]), ALLEXCEPT('Table', 'Table'[Project_Number], 'Table'[Proposal Number]))
    

     

    Community Support Team _ Jimmy Tao

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