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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Filter where date column between 2 relative dates

I have a measure that needs to meet the following conditions:

  • Sums the amount of hours for a task, where the starttime of the task is between
    • The the first date of the previous quarter
    • The last date of 3 quarters into the future

I'm so confused by the fact that DATEADD requires a vector format instead of a scalar, so I can't use the TODAY function.

 

The closest I've gotten is

Measure1 = CALCULATE(SUM(Tasks[hours]) / 60, DATESBETWEEN(Tasks[Startdate], FIRSTDATE(DATEADD(STARTOFQUARTER('Date'[Date]), -1, QUARTER)), LASTDATE(DATEADD(ENDOFQUARTER('Date'[Date]), 3,QUARTER))))
 
In this Measure the date table is a custom range of subsequent days similar to many other such tables found on this forum.
 
I hope someone can help me find a solution. Which might also include filters or slicers. I haven't gotten those to work because of my need for quarters, which aren't present in filters.
1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try a measure like

Rolling 4 = CALCULATE(SUM(Tasks[hours]) / 60,DATESINPERIOD('Date'[Date],maxx('DAte',STARTOFQUARTER( DATEADD('Date'[Date],-1,QUARTER)),4,QUARTER)) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.