Forum Discussion

AlexPayette's avatar
AlexPayette
Frequent Visitor
3 years ago

Calculating Sum of Hierarchy with InScope, total not adding properly (sum of hierarchy)

Hi, I am trying to create a measure in DAX where I calculate different totals based on a hierarchy-level using the InScope function. 

 

This is what my measure looks in DAX : 

Measure =
VAR JPDevRestants =
(CALCULATE(SUM(Issues[Original Estimate Seconds]),
--    ALLSELECTED(Projects[Project Name]),
    FILTER(StatusCategory,StatusCategory[Status Category Name] <> "Done"),
    FILTER(Issues,Issues[FK IssueTypeId] <> 10061)
--    FILTER(Issues,Issues[FK LastSprintId] = MIN(Issues[FK LastSprintId])),
    --USERELATIONSHIP(Issues[Status Category Change Date],'Date'[Date])
))/27000

VAR JPDevSprint = BLANK()

VAR JPDevBoard =
CALCULATE(JPDevRestants,ALLSELECTED(Sprints[Sprint Name - Start Date]))

VAR JPDevProjet =
CALCULATE(JPDevRestants,ALLSELECTED(Boards[Board Name]))

RETURN
  SWITCH (TRUE(),
    ISINSCOPE(Sprints[Sprint Name - Start Date]),JPDevSprint,
    ISINSCOPE(Boards[Board Name]),JPDevBoard,
    ISINSCOPE(Projects[Project Name]),JPDevProjet
  )

 

And this is what the results looks like : 

 

Projects82
Boards 
Board Name (1)5
Board Name (2)42
Board Name (3)82
Sprints 

 

The problem I have is regarding the hierarchy 1, Projects, instead of summing the numbers of the boards (board 1, board 2, board 3), I only get the result of the board 3, 82. 

 

What I want is summing all boards at the project level, so I am asking if someone would have a solution on this one.

 

 

Thank you,

1 Reply

  • Please provide sanitized sample data that fully covers your issue.
    Please show the expected outcome based on the sample data you provided.