Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AlexPayette
Frequent Visitor

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 1
lbendlin
Super User
Super User

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.