Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Sum by two groups

Hi everyone , I need help with this issue i have a table visual:

UserlevelSalery
A134
B232
B237
C126
C328
C129
D333
E130


 if i remove the level column i want this:

A34
B69
C83
D33
E30

 its possible to do it in measure?

7 Replies

  • Hi Anonymous ,

    Try this measure below which is similar to COUNTIF in Excel:

    MyMeasure =
    CALCULATE ( SUM ( Table[Salery] ), ALLEXCEPT ( Table, Table[User] ) )
    //will return the sum of Salery for each User

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for your reply but it doesnt work 😞 , i didnt get the result

      • danextian's avatar
        danextian
        Super User

        What would your formula be if you did it in Excel?

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

    Hi Anonymous ,

     

    One point of confusion, if you remove the level column, Power BI will automatically calculate the Salery.

    If i misunderstood you, please let me know and share your pbix file without sensitive data and expect result.

    Best Regards

    Community Support Team _ chenwu zhu

     

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

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

        Hi Anonymous ,

         

        Sorry, still don't quite understand what you want the result to look like. Please give what you want the result to look like, hand-drawn is fine.

         

        Best Regards

        Community Support Team _ chenwu zhu