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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Flag Current QTR

Hello,

I have to add a column QTR_FLAG in the table. Our FY starts in April.
So, in a table(below) max YrMo will always be a previous month not a current Month.
- If max year YrMo is 201809, then I want to Flag column QTR_FLAG 201809, 201808, and 201807 = 1 all other rows = 0

- If max year YrMo is 201811, then I want to Flag QTR_FLAG 201811 and 201810 = 1 all other rows = 0

 

So in a nuttshell, only current Fiscal Quarter will have value = 1 all other will be 0s

Grid.jpg
Thanks is advance

1 ACCEPTED SOLUTION
LivioLanzo
Solution Sage
Solution Sage

Should be something like this if i understand correctrly:

 

VAR RefDate = TODAY()
VAR YrMoReference  = YEAR( EOMONTH( RefDate, -1 ) ) * 100 + MONTH( EOMONTH( RefDate, -1 ) )
VAR QtrReference = CALCULATE( MIN( Dates[qtr] ), ALL( Dates ), Dates[YrMo] = YrMoReference )
VAR FYReference = CALCULATE( MIN( Dates[fy] ), ALL( Dates ), Dates[YrMo] = YrMoReference )
RETURN
IF( Dates[FY] = FYReference && Dates[QTR] = QtrReference, 1, 0 )

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

1 REPLY 1
LivioLanzo
Solution Sage
Solution Sage

Should be something like this if i understand correctrly:

 

VAR RefDate = TODAY()
VAR YrMoReference  = YEAR( EOMONTH( RefDate, -1 ) ) * 100 + MONTH( EOMONTH( RefDate, -1 ) )
VAR QtrReference = CALCULATE( MIN( Dates[qtr] ), ALL( Dates ), Dates[YrMo] = YrMoReference )
VAR FYReference = CALCULATE( MIN( Dates[fy] ), ALL( Dates ), Dates[YrMo] = YrMoReference )
RETURN
IF( Dates[FY] = FYReference && Dates[QTR] = QtrReference, 1, 0 )

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.