Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculation query

Hello community,

 

I need help with the following query:

I need to calculate the count of ID where, if Directors is less than 5 then add it into managers. That is as shown below image manager's count should be 6.

 

 

Thanks in advance.

Regards

 

  • Hi Anonymous ,

     

    Can you provide some example data from your table?

     

    Jori

4 Replies

  • jppv20's avatar
    jppv20
    Solution Sage

    Hi Anonymous ,

     

    This should work.

    Add a new column in your table:

    Team Level 2 = IF('Table'[Team Level]="Directors","Managers",'Table'[Team Level])

     

    Create a new table:

     

    Create two relationships between the tables:

     

    Then create this measure:

    Measure = IF(CALCULATE(COUNT('Table'[ID]),'Table'[Team Level]="Directors")<5,CALCULATE(COUNT('Table'[ID]),USERELATIONSHIP('Team Level'[Team Level],'Table'[Team Level 2])),CALCULATE(COUNT('Table'[ID])))

     

    This will give the following result:

     

    Jori

     

    If I answered your question, please mark it as a solution to help other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for the solution. Works for me 👍

      Really appreciate it!

       

  • jppv20's avatar
    jppv20
    Solution Sage

    Hi Anonymous ,

     

    Can you provide some example data from your table?

     

    Jori

    • Anonymous's avatar
      Anonymous
      Not applicable

      Here is the sample data: