Dear Friends
First of all, I am a beginner. I need help. I created a code to provide me a spent hour in sub-tasks, as shown below (figure):
Aggregate(Filter(
[Time].[Day].Members,
DateBetween([Time].CurrentMember.StartDate,
'2023-01-25','2023-02-06')
))
It is used to build the graph below:
However, my report was created with fixed date. I would like to create a code to capture the date range between 25th day from previous month and 6th day of current month, without to specify the year or month. Somebody could explain me how to modify this code to capture the range mentioned previously ? It must work with any sequencial two months ?
Thanks in advanced
Jairo
Well, I found a solution. I am sharing here. If somebody has a better one, please share here.
Aggregate(
IIf(Month(Now())=1,
[Time].[day].DateMembersBetween(
DateSerial(Year(Now())-1,12,25),
DateSerial(Year(Now())-1,1,6)),
[Time].[day].DateMembersBetween(
DateSerial(Year(Now()),Month(Now()) - 1,25),
DateSerial(Year(Now()),Month(Now()),6)
)
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.