Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

how to use Datebetween command for two generic data interval

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')
))

CODE.jpg

It is used to build the graph below:

GRAPH.jpg

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

1 answer

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)
  )
)

 

CODE_FINAL.jpg

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events