Average story size

Hello,
I’m trying to get a measure of the average story size (in story points) for a sprint, but I’m struggling with the need to exclude subtasks.
How can I exclude them?
thanks.

I built this but it seems to work only with open sprints:

CASE WHEN
  [Sprint].Currentmember.Level.name = 'Sprint'
THEN
    Avg(
      Filter(
        Descendants([Issue].Currentmember, [Issue].[Issue]),
        [Sprint].CurrentMember.Name = [Measures].[Issue Sprint]
        AND
        [issue].CurrentMember.Get('Story Points') > 0
      ), [issue].CurrentMember.Get('Story Points')
    )
END
1 Like

It cannot work, I’ll leave this here in case anyone makes my own mistake.
You can’t use [issue] dimension without including it in the cube you’re watching.
I arranged a measure using sprint level measures:

 [Measures].[Sprint Story Points at closing]/
([Measures].[Sprint issues at closing] - 
([Issue Type].[Sottotask], [Measures].[Sprint issues at closing]))