Forum Discussion
Rolling 4 Quarter Flag
Hi,
I'm trying to create a calculated column in my date table that I can use as a filter that is a rolling 4 quarters. So from the start of the current quarter and then the following 3. Here is my current formula but it isn't working... I feel like I'm close. Does anyone have any suggestions?
Thanks!
Hi Anonymous ,
Please try to add ALL() functions in both calculated exporessions:
Test = VAR _Today = TODAY () VAR _QuarterStart = CALCULATE ( STARTOFQUARTER ( 'Date'[Date] ), FILTER ( ALL ( 'Date' ), 'Date'[Year] = YEAR ( _Today ) && 'Date'[QuarterNo] = QUARTER ( _Today ) ) ) VAR _QuarterEnd = CALCULATE ( STARTOFQUARTER ( 'Date'[Date] ), FILTER ( ALL ( 'Date' ), 'Date'[Year] = YEAR ( _Today ) + 1 && 'Date'[QuarterNo] = QUARTER ( _Today ) ) ) RETURN IF ( 'Date'[Date] >= _QuarterStart && 'Date'[Date] < _QuarterEnd, 1, 0 )Attached a sample file in the below, hopes it could help.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-yingjl
Community Support
Hi Anonymous ,
Please try to add ALL() functions in both calculated exporessions:
Test = VAR _Today = TODAY () VAR _QuarterStart = CALCULATE ( STARTOFQUARTER ( 'Date'[Date] ), FILTER ( ALL ( 'Date' ), 'Date'[Year] = YEAR ( _Today ) && 'Date'[QuarterNo] = QUARTER ( _Today ) ) ) VAR _QuarterEnd = CALCULATE ( STARTOFQUARTER ( 'Date'[Date] ), FILTER ( ALL ( 'Date' ), 'Date'[Year] = YEAR ( _Today ) + 1 && 'Date'[QuarterNo] = QUARTER ( _Today ) ) ) RETURN IF ( 'Date'[Date] >= _QuarterStart && 'Date'[Date] < _QuarterEnd, 1, 0 )Attached a sample file in the below, hopes it could help.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.