I'm pretty sure this is a simple one.
I am an MDX novice working on "Report Months" query, getting incorrect "All" calculation. See the report below. The "All" total should be 278 if you add all the all the report months members (23 X 12 + 1 + 1 = 278), but report keeps calculating as the Grand Total as 289.
Report months are simply a count of the Date - Paid Months in the report.
I'm certain the answer has something to do with the IIF portion of the code. I'm checking DatePaid to see if it's the current year and if the current month is < 12 and am returning Month(Now()) if that is the case.
Mdx =
with member ReportMonths
as
IIF([Date - Paid].[calendar].CurrentMember.MEMBER_CAPTION = "Calendar " + CStr(Year(Now())) AND MONTH(Year(Now())) < 12
, MONTH(Now())
, Count(Existing([Date - Paid].[Calendar].[Month]))
)
SELECT ReportMonths on columns,
[Date - Paid].[Year].Members on rows
from [My Cube]
Report look like this.
Thanks so much for your time,
Cary