Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Calculating measures based on different hierarchy levels

Hi All,   I need to know how to perform calculations on different levels of a hierarchy.    Take this matrix as an example;                                   Say the Custo...
  • Anonymous's avatar
    Anonymous
    7 years ago

    So I managed to solve this using this DAX:

     

    IF (
      ISFILTERED ( AgentTable[EmployeeID] ),
      CALCULATE([STDEVP.1_Duration],ALL(AgentTable[EmployeeID])) - SUM(Duration),
         IF (
            ISFILTERED ( AgentTable[TeamID] ),
            CALCULATE([STDEVP.1_Duration],ALL(AgentTable[TeamID]))- SUM(Duration),
                 IF (
                     ISFILTERED ( AgentTable[DeptID] ),
                     CALCULATE([STDEVP.1_Duration],ALL(AgentTable[DeptID]))- SUM(Duration),
                         IF (
                            ISFILTERED ( AgentTable[ClientID]),
                            CALCULATE([STDEVP.1_Duration],ALL(AgentTable[ClientID]))- SUM(Duration)
    
            )
        )
    )