Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Category wise calculation using a measure

I have 8 categories in my data, I want to calculate a percentage value or a metric

If the user belongs to categories 1,3,2,8 then I want a formula to apply to them, lets call it as formula a - sum[a+b+c+d]

If the user belongs to categories 4,5,6,7 then I want a formula to apply to them, lets call it as formula b -sum [a*10+d*10+e*10]

 

How to achieve this?

 

MFelix Fowmy 

4 Replies

  • Anonymous 

    You can use this pattern:

    Measure = 
    CALCULATE(
        SUM(Table[Value]),
        Table[user] IN {1,3,2,}
    )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Fowmy I tried doing the same pattern but it doesn't seem to work well with 2 sets of groups. How can I modify my dax?

      • Fowmy's avatar
        Fowmy
        Icon for Super User rankSuper User

        Anonymous 

        Please share your formula and the sample data