Tuesday, July 25, 2017

SSAS MDX- MDX: Sorting

We can sort an axis based on the member on that axis, or on the measure.
Based on the member:                        Based on the measure:
To sort an axis based on the member, we can use the NAME property:
select non empty
order
( {[Customer].[City].[All].Children},
[Customer].[City].CurrentMember.Name, DESC
) on 1,
[Measures].[Internet Sales Amount] on 0
from [Adventure Works];
To sort an axis based on the measure, we use the measure name:
select non empty
order
( {[Customer].[City].[All].Children},
[Measures].[Internet Sales Amount], DESC
) on 1,
[Measures].[Internet Sales Amount] on 0
from [Adventure Works];

No comments:

Search This Blog

DAX - Grouping on multiple columns and the count

Please go thorugh the below URL for entire soultion. http://community.powerbi.com/t5/Desktop/DAX-Grouping-on-multiple-columns-and-the-cou...