cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AnetaK Member
Member

Calendar - end of quarter

Hello,

 

I've created a calendar table that ends today.

Calendar = CALENDAR(MIN(Task[ActivityDate]);TODAY())

 

Now I would like to change it, so that it ends with the end of current quarter, I need some future dates.

I don't have any existing column with dates, I am creating it, so I can not use ENDOFQUARTER as it requires a column.

 

What should I write in DAX?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Calendar - end of quarter

Not entirely sure I understand your requirements, but if this needs to be dynamic per day, you might do something like:

 

Calendar = var MonthToday = MONTH(TODAY())
var YearToday = YEAR(TODAY())
var EndDate = IF(MonthToday<4,DATE(YearToday,3,31),IF(MonthToday<7,DATE(YearToday,6,30),IF(MonthToday<10,DATE(YearToday,9,30),DATE(YearToday,12,31))))
RETURN
CALENDAR(MIN(Task[ActivityDate]),EndDate)

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


4 REPLIES 4
AnetaK Member
Member

Re: Calendar - end of quarter

I've got an idea.

 

Calendar = CALENDAR(MIN(Task[ActivityDate]);TODAY()+92)

I've added a maximum number od days in a potential quarter.

That can help. But is it the proper solution?

Super User
Super User

Re: Calendar - end of quarter

Not entirely sure I understand your requirements, but if this needs to be dynamic per day, you might do something like:

 

Calendar = var MonthToday = MONTH(TODAY())
var YearToday = YEAR(TODAY())
var EndDate = IF(MonthToday<4,DATE(YearToday,3,31),IF(MonthToday<7,DATE(YearToday,6,30),IF(MonthToday<10,DATE(YearToday,9,30),DATE(YearToday,12,31))))
RETURN
CALENDAR(MIN(Task[ActivityDate]),EndDate)

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


AnetaK Member
Member

Re: Calendar - end of quarter

Yes, it needs to be dynamic.

Thank you Smiley Happy

Super User
Super User

Re: Calendar - end of quarter

Cool, hope that formula works for you!


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!