2016-02-25 57 views

回答

1

你需要添加一些你已經嘗試過的代碼。

mdx僞代碼將是這樣的:

Except( 
    NonEmpty(
     {all members}      //<<try a function that returns a set such as `.MEMBERS` 
     ,(thisMonth, OrderAmountMeasure) //<<the braces mean this is a tuple made up of two members 
    ) 
    ,NonEmpty(
     {all members}     
     ,(equivMonthLastYear, OrderAmountMeasure) //<<you could try the .LAG function to go back 12 months 
    ) 
    ) 

編輯:

iif(
    equivMonthLastYear = 0, 
    null, 
    Except( 
    NonEmpty(
     {all members}      //<<try a function that returns a set such as `.MEMBERS` 
     ,(thisMonth, OrderAmountMeasure) //<<the braces mean this is a tuple made up of two members 
    ) 
    ,NonEmpty(
     {all members}     
     ,(equivMonthLastYear, OrderAmountMeasure) //<<you could try the .LAG function to go back 12 months 
    ) 
    ) 
) 
+0

你的僞代碼工作,除了當有在多維數據集equivMonthLastYear沒有價值。在這種情況下,我不想返回currentMonthThisYear。 – user5982263

+0

@ user5982263您可以通過'IIF'功能添加一些額外的邏輯:https://msdn.microsoft.com/en-us/library/ms145994.aspx?f=255&MSPPError=-2147217396 – whytheq

相關問題