Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AnetaK
Helper V
Helper V

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
Greg_Deckler
Super User
Super User

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)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

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)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Yes, it needs to be dynamic.

Thank you 🙂

Cool, hope that formula works for you!


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
AnetaK
Helper V
Helper V

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?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.