cancel
Showing results for
Did you mean:
Highlighted
Member

Calendar - end of quarter

Hello,

I've created a calendar table that ends 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

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

Proud to be a Datanaut!

4 REPLIES 4
Member

Re: Calendar - end of quarter

I've got an idea.

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

That can help. But is it the proper solution?

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

Proud to be a Datanaut!

Member

Re: Calendar - end of quarter

Yes, it needs to be dynamic.

Thank you

Super User

Re: Calendar - end of quarter

Cool, hope that formula works for you!