Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Using SUM on Column A based on value in Column B?

Hello all,

 

As the title suggests I need to evaluate one column and then sum the value in the next. My data looks like this...

Column AColumn B
Open-
Open-
Closed15
Open-
Closed2
Closed28

 

Regards,

J

  • parry2k's avatar
    parry2k
    6 years ago

    Anonymous add a measure with the following expression

     

    Sum = CALCULATE ( SUM ( Table[Col B] ), Table[Col A] = "Closed" )

     

    Change table and column name as per your model.

     

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

3 Replies

  • Anonymous not sure I understood, what suppose to be the expected output.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey,

       

      Sorry I probably should have explained better...

       

      Look for all values that are "closed" in A then SUM "B"

      • parry2k's avatar
        parry2k
        Super User

        Anonymous add a measure with the following expression

         

        Sum = CALCULATE ( SUM ( Table[Col B] ), Table[Col A] = "Closed" )

         

        Change table and column name as per your model.

         

         

        I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!