Forum Discussion

JC2022's avatar
JC2022
Icon for Helper III rankHelper III
3 years ago
Solved

Sum per category in another table

Hi,

How do I create a measure where I calculate the TT_HRS[TT_Hours] per TT_ACT[Category]?

 

 

  • JC2022's avatar
    JC2022
    3 years ago

    FreemanZ 

    It's not working. I only get a calculated sum for one category. I would expect to get a calculated sum for each category.

4 Replies

  • Do you have more info about the relationship between TT_HRS and TT_ACT? What are the two linked columns?

    • JC2022's avatar
      JC2022
      Icon for Helper III rankHelper III

      The link is:

      TT_ACT[Activity ID] one-to-many TT_HRS[TT_ACT_ID]

      • FreemanZ's avatar
        FreemanZ
        Icon for Super User rankSuper User
        try to create a measure with this:
         
        Measure = 
        CALCULATE(
            SUM(TT_HRS[TT_Hours]),
            USERELATIONSHIP(
                TT_ACT[Activity ID],
                TT_HRS[TT_ACT_ID]
            )
        )
         
        you would need to plot a Visual with TT_ACT[Category].