Below is an MDX Query which returns the sales of different product categories:
select {[Dim Category].[Category].[Category]} on 1,
{[Measures].[Measure Value]} on 0
from [MY CUBE]
result set returned:
We can see that the maximum value is 42092.83. Using max and axis function, we can show the maximum value as a seperate measure. So, we add a measure and the query becomes :
with
member [Measures].[MAXSales]
as
max(axis(1),[Measures].[Measure Value])
select {[Dim Category].[Category].[Category]} on 1,
{[Measures].[Measure Value],[Measures].[MAXSales]} on 0
from [MY CUBE]
the result set looks like this:
Hi, Thanks very much for this solution. But on using this code my measure value becomes absurd and does not remain same after adding MAX calculated emmber. Please help.
It’s probably because of Axis. Check if you are referring the correct axis or not.
Many thanks. It worked for me.