Search code examples
ssasmdxolapcube

MDX count number of days with Invoice amount greater than 0


I wish to great a calculated measure "Dispatch days" in SSAS Visual Studios that counts the number of days where there has been a sales transaction made, i.e Invoice Amount greater than 0. So if I look at 2018 it should give me the number of days that year, where there were sales. I tried using this

COUNT(Filter(
           Descendants([D_Time].[Year-Month-Day].currentmember,[D_Time]. 
           [Year-Month-Day].[Day]),[Measure].[Invoice Amount LOC] >0
 ))

but it only gives me null.

Best regards, Rubrix


Solution

  • A better approach would be, however I suppose that a year is specified in one of the axis

    count(nonempty(Descendants([D_Time].[Year-Month-Day].currentmember,[D_Time].[Year-Month-Day].[Day]),[Measure].[Invoice Amount LOC]))