Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

How to get Cube.MeasureProperty using MDX

Hi,

I have a BW cube for which I want to extract data using an MDX query.

What I am hving trouble with is to extract some measure properties.

In the query designer in Power BI, it would look like this

The code resulting from the above selection is as following:

If the "Unit of measure" property was a dimention property in stead of a measure property then the M function to be used would have been "Cube.AttributeMemberProperty" instead of "Cube.MeasureProperty".

 

The Cube.AttributeMemberProperty translates as following in MDX 

DIMENSION PROPERTIES [DimensionTechnicalName].[HierarchyTechnicalName].[PropertyTechnicalName]

 

But I could not find a way to translate the "Cube.MeasureProperty" in MDX.

 

Can anyone helpe me with my issue 🙃 ?

 

1 Reply

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Anonymous 

     

    Just bring the measure into Power Query then try right-clicking on a step in the Applied Steps pane and selecting the View Native Query option. If this option is not greyed out, it will show you how the M codes are translated into the native query of the data source. Give it a try!

    Chris Webb's BI Blog: View Native Query Now Works For Analysis Services Data Sources

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.