Skip to content

Instantly share code, notes, and snippets.

@osya
Created January 25, 2015 09:43
Show Gist options
  • Save osya/aff6fc1f075dd1b9233b to your computer and use it in GitHub Desktop.
Save osya/aff6fc1f075dd1b9233b to your computer and use it in GitHub Desktop.
Calculate average value of members on the level immediately beneath #MDX #SSAS #BI
WITH MEMBER [Measures].[Average of an average] AS iif( IsLeaf( [Date].[Fiscal Weeks].CurrentMember ),
[Measures].[Order Count], Avg( [Date].[Fiscal Weeks].CurrentMember.Children, [Measures].[Average of an average] ) )
, FORMAT_STRING = '#,#'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment