Hi,
It is not totally clear what your requirement is for the average that "without aggregation?"
I guess you are expecting to calculate average without summation ?
I think you could use Avg() function of MDX. You could check examples and specifics in the doc : MDX-Avg
This function is directly calculate averages with respect to given set.
Regards,
Lukas
Dynamic Filtring in mdx Queries
hello...
I need to deal with MDX query in SSAS tabular Server...
That went almost ok with measures with summation
but this is not ok if I decided to work with measures that Deal with Averages.. Since the average calculation is already defined in the model
.. but if you use it in mdx query then you must aggregate for totals.. such as sum(average) or average(average)..
is there a way that I can build an mdx query with dynamic total... without any aggregations.... this is my query
WITH
MEMBER [Measures].[MALES] AS
(
[DIM_GENDER].[DIM_DESC_EN].&[MALE]
,[Measures].[Total Persons]
)
MEMBER [Measures].[FEMALES] AS
(
[DIM_GENDER].[DIM_DESC_EN].&[FEMALE]
,[Measures].[Total Persons]
)
MEMBER [Measures].[TOTALS] AS
Sum
(
{
[DIM_GENDER].[DIM_DESC_EN].&[MALE]
,[DIM_GENDER].[DIM_DESC_EN].&[FEMALE]
}
,[Measures].[Total Persons]
)
MEMBER [DIM_NATIONALITY].[SHORT_NATIONALITY].[TOTAL] AS
Aggregate
(
{
[DIM_NATIONALITY].[SHORT_NATIONALITY].&[US]
,[DIM_NATIONALITY].[SHORT_NATIONALITY].&[NOT US]
}
)
SELECT
NON EMPTY
{
[Measures].[MALES]
,[Measures].[FEMALES]
,[Measures].[TOTALS]
} ON COLUMNS
,NON EMPTY
Union
(
{
[DIM_NATIONALITY].[SHORT_NATIONALITY].[SHORT_NATIONALITY].MEMBERS
}
,[DIM_NATIONALITY].[SHORT_NATIONALITY].[TOTALS]
) ON ROWS
FROM [Model];
1 answer
Sort by: Most helpful
-
Lukas Yu -MSFT 5,821 Reputation points
2020-08-18T06:57:44.977+00:00