Split-by-Component measure different results in table and drill-though-issue

Utilizing the following measure (_foo) to test the splitting of Story Points in issues with multiple components:

CASE WHEN
--one or more issue components exist
  CACHE(
    Count(
      Filter(
        [Project].[Component].GetMembersByKeys(
        [Issue].CurrentHierarchyMember.Get('Component IDs')),
        [Measures].[Story Points resolved] > 0
      )
    )
  ) > 0
THEN
  CASE WHEN
  --multiple or all components selected on page filter
    ([Project].Level.Name = "(All)"
    OR
    [Project].Level.Name = "Project")
      AND
      [Measures].[Story Points resolved] > 0
  THEN
  --hours spent when ignoring components
    ([Project].DefaultMember,
    [Measures].[Story Points resolved])
    /
--divide by the number of applicable components  
   Count(
     Filter(
        [Project].[Component].GetMembersByKeys(
        [Issue].CurrentHierarchyMember.Get('Component IDs')),
        ([Measures].[Story Points resolved]) > 0))
   *
  --multiply by the number of components selected
   Count(
     Filter(
       DescendantsSet([Project].CurrentHierarchyMember, [Project].[Component]),
       [Measures].[Story Points resolved] > 0
      )
    )
  ELSE
  --split values per each component
  --take the total value regardless of components
    ([Project].DefaultMember,
    [Measures].[Story Points resolved])
    /
  --divide by the number of components applicable
    Count(
      Filter(
        [Project].[Component].GetMembersByKeys(
        [Issue].CurrentHierarchyMember.Get('Component IDs')),
        [Measures].[Story Points resolved] > 0
      )
    )
  END
ELSE
--no issue components exist
  [Measures].[Story Points resolved]
END

The issue selected has a value of three story-points and incorporates two components.
Now note the differing highlighted values on the table and drill-through-issue screenshots:



The drill-through-issue value of 3 is the correct value; why does the table depict 6 and the drill-through-issue total-value indicate 6?

Hi,

The difference between what you see in the report cell and what you see in the drill-through is that this formula enters different branches depending on whether you look in the report or drill-through.

The initial condition will always be false at the report level because it refers to the Issue dimension which is not used in the report:

  CACHE(
    Count(
      Filter(
        [Project].[Component].GetMembersByKeys(
        [Issue].CurrentHierarchyMember.Get('Component IDs')),
        [Measures].[Story Points resolved] > 0
      )
    )
  ) > 0

This condition will often be valid once you use the Issue dimension in the report (that is what happens when you do a drill-through).

So, at the report level, the condition will always lead to this branch:

--no issue components exist
  [Measures].[Story Points resolved]

I do not see the full picture of what you use in the report filters, but there is a side effect that could explain the multiplied value at the report level. Once you filter by several values of the multi-value dimension (like Project. Component), the value is multiplied by the number of selections if an issue matches several values (e.g., you have an aggregate of several components, and the issue has several of them).

So one suggestion is to use the “distinct count” of the resolved story points at the report level:

--no issue components exist, count distinct
  Sum (Filter(Descendants([Issue].CurrentMember,[Issue].[Issue]),
  DateInPeriod([Measures].[Issue resolution date],[Time].CurrentHierarchyMember)
  AND
  [Measures].[Issues resolved]>0
  ),
  ([Measures].[Story Points resolved],[Project].DefaultMember)
  )

Kindly,