Forum Discussion

keobrie's avatar
keobrie
Icon for Helper I rankHelper I
7 years ago
Solved

MDX Expression as Card Field in SSAS Live Connection based on Slicer criteria

I have a multi-page PowerBI report with a Live Connection to an SSAS Multidimensional Cube.    On one of the pages I have a monthly run chart (stacked bar chart) whose scope is governed by a slicer...
  • TeigeGao's avatar
    7 years ago

    Hi keobrie ,


    "Can I use an MDX expression in the Card Field that in turn uses the last value of the slicer to govern the value in the Card Field value"


    We cna create two measure for each visual, one uses the full period and another uses the current three months, for the measure of current months, we can refer to the following query:

    CREATE MEMBER CURRENTCUBE.[Measures].[current previous 3]  as
    SUM
    (
       [Date].[Calendar Date].CurrentMember.Lag(3) : 
       [Date].[Calendar Date].CurrentMember.lag(1), 
       [Measures].[Internet Sales Count]
    );

    If you have other problem related to SSAS, I would suggest you opening a case in SSAS MSDN forum at https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=sqlanalysisservices

    Best Regards,

    Teige