Hi,
I assume you are talking about current date as for the current quarter.
We could get to 1st month of quart by using following logic:
Quarter Number :Round((MonthNumber + 1)/3)
1st month in Quarter : QuarterNumber*3 - 2
The 1st day in 1st month of current quarter would be :
With MEMBER [Date].[Date].[firstOfMonthOfQuarter] as OpeningPeriod( [Date].[Calendar].[Date],
StrToMember("[Date].[Calendar].[Month].&[" +
Format(now(), "yyyy") + "]&[" + CSTR(ROUND ((Month(Now())+ 1)/3)*3-2 ) + "]"))
And the last date would be :
MEMBER [Date].[Date].[LastOfMonthOfQuarter] as ClosingPeriod( [Date].[Calendar].[Date],
StrToMember("[Date].[Calendar].[Month].&[" +
Format(now(), "yyyy") + "]&[" + CSTR(ROUND((Month(Now())+ 1)/3)*3-2 ) + "]"))
Then find the max
MEMBER [Measures].[x] AS Max(
[Date].[Date].[firstOfMonthOfQuarter]:[Date].[Date].[LastOfMonthOfQuarter],[Measure].[OrderQty]
)
SELECT [Measures].[x] on 0
FROM [yourCube]
You could make adjustment on these code combine them to get what you want.
Regards,
Lukas
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.