Search code examples
ssasmdx

Query to Display Folder of the measure


I am trying to select a display folder of a measure (folder that I can see in the Excel Pivot Table under the measure group, under which a measure is displayed).

I tried with something like this:

WITH
    MEMBER [Measures].[FOLDER_NAME] AS [Measures].[Amount].Properties('DISPLAY_FOLDER')
SELECT
    [Measures].[FOLDER_NAME] On 0
FROM
    MyCube

But I am getting an error: #Error Query The DISPLAY_FOLDER dimension attribute was not found. Maybe name of the property doesn't go like this or am I missing something else?

Because when I try with some other property like NAME instead of DISPLAY_FOLDER I am getting correct result - the name of the measure:

WITH
    MEMBER [Measures].[MEASURE_NAME] AS [Measures].[Amount].Properties('NAME')
SELECT
    [Measures].[MEASURE_NAME] On 0
FROM
    MyCube

Solution

  • I dont think folder name is accessible in this way. However you can use Dmv's to solve your issue.

    select * from $System.MDSCHEMA_MEASURES
    

    In the result check the MEASUREGROUP_NAME