Forum Discussion
Dynamic Current Quarter Filter
- 4 years ago
My apologies, I needed to shift the moths a bit. Give this a try:
Current Qtr = VAR _StartOfQtr = DATE ( YEAR ( TODAY() ), FLOOR ( MONTH ( TODAY() ) -1 , 3 ) + 1 , 1 ) VAR _EndOfQtr = EOMONTH ( _StartOfQtr, 2 ) RETURN [Date] >= _StartOfQtr && [Date] <= _EndOfQtr
You can add a column to your Calendar table like this.
Current Qtr =
VAR _StartOfQtr = DATE ( YEAR ( TODAY() ), FLOOR ( MONTH ( TODAY() ) -1 , 3 ), 1 )
VAR _EndOfQtr = EOMONTH ( _StartOfQtr, 3 )
RETURN
[Date] >= _StartOfQtr && [Date] <= _EndOfQtr
Then just set a filter on that column for True. When the date rolls into next quarter the dates flagged True will shift to the new quarter.
Hi,
Thank you. This is close however, _StartOfQtr is returning the 1st of September as the start of the quarter resulting in four months instead of the quarter starting on the 1st of October.
- jdbuchanan714 years agoSuper User
My apologies, I needed to shift the moths a bit. Give this a try:
Current Qtr = VAR _StartOfQtr = DATE ( YEAR ( TODAY() ), FLOOR ( MONTH ( TODAY() ) -1 , 3 ) + 1 , 1 ) VAR _EndOfQtr = EOMONTH ( _StartOfQtr, 2 ) RETURN [Date] >= _StartOfQtr && [Date] <= _EndOfQtr- MBPCCX4 years agoAdvocate I
Perfect thank you!
- AlmantasPBIguy4 years agoFrequent Visitor
Hey, is there a way to reuse this for last two quarters? Meaning current + last quarter?
- jdbuchanan714 years agoSuper User
That would look somehting like this.
Current Qtr = VAR _StartOfQtr = DATE ( YEAR ( TODAY() ), FLOOR ( MONTH ( TODAY() ) -1 , 3 ) + 1 , 1 ) VAR _StartOfPQtr = EOMONTH ( _StartOfQtr, -4 ) +1 VAR _EndOfQtr = EOMONTH ( _StartOfQtr, 2 ) RETURN [Date] >= _StartOfPQtr && [Date] <= _EndOfQtr
- AndrewKuharich3 years agoRegular Visitor
Hello - May I ask for a formula that would return "the current and next 3 Quarters", please?
Thank you!