Rewrite SSAS MDX Query without Axis Function

D Samuel 21 Reputation points
2022-01-28T17:28:13.577+00:00

need help to rewrite this SSAS MDX Query without Axis Function cause Axis is not supported in Power BI. Using a tabular cube is not a option for me.

CASE WHEN
ISEMPTY( [Measures].[Return @Retail] )
THEN
0
ELSE
IIF(
ISEMPTY( Axis(1).Item(0).Item(0).Dimension.CurrentMember.Parent )
,1
, [Measures].[Return @Retail] / ( Axis(1).Item(0).Item (0).Dimension.CurrentMember.Parent, [Measures].[Return @Retail] )
)

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,344 questions
0 comments No comments
{count} votes

Accepted answer
  1. Alexei Stoyanovsky 3,416 Reputation points
    2022-01-29T12:57:33.007+00:00

    This is not a query, this is a definition of a calculated member, probably in the Measures dimension. The member calculates the ratio-to-parent for the first attribute that the user put on rows in an actual MDX query when using the cube.
    Unfortunately, the Axis function is the only way to tell the engine to check this query-time user's choice. Since your client doesn't support it, you'll have to come up with a supported functional equivalent, which will most probably be less universal than what the Axis function allows.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.