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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ak28121
Frequent Visitor

Date table flag calculations

I've a calendar table consist of Date,Year column , Now i want to derive below flags under my calendar table
1)Current fiscal year flag
2)previous year flag
3)current fiscal quarter flag,
4)previous fiscal quarter flag,
5)previous fiscal year current quarter flag,
Note- fiscal year starts from Jan and ending in december,

Thanks in advance 🙂

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@ak28121 

pls try this

year = year('Table'[Date])
 
quarter = QUARTER('Table'[Date])
 
currentfiscalyear = if([year]=year(TODAY()),"Y")
 
previousfiscalyear = if('Table'[year]=year(TODAY())-1,"Y")
 
currentfiscalquarter = if('Table'[year]=year(TODAY())&&'Table'[quarter]=QUARTER(today()),"Y")
 
previous fiscal quarter =
 if(QUARTER(today())=1,if('Table'[year]=year(today())-1&&'Table'[quarter]=4,"Y"),
 if('Table'[year]=year(today())&&'Table'[quarter]=QUARTER(today())-1,"Y"))
 
previous fiscal year current quarter = if('Table'[year]=year(today())-1&&'Table'[quarter]=QUARTER(today()),"Y")
 
 
 pls see the attachment below




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

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@ak28121 

pls try this

year = year('Table'[Date])
 
quarter = QUARTER('Table'[Date])
 
currentfiscalyear = if([year]=year(TODAY()),"Y")
 
previousfiscalyear = if('Table'[year]=year(TODAY())-1,"Y")
 
currentfiscalquarter = if('Table'[year]=year(TODAY())&&'Table'[quarter]=QUARTER(today()),"Y")
 
previous fiscal quarter =
 if(QUARTER(today())=1,if('Table'[year]=year(today())-1&&'Table'[quarter]=4,"Y"),
 if('Table'[year]=year(today())&&'Table'[quarter]=QUARTER(today())-1,"Y"))
 
previous fiscal year current quarter = if('Table'[year]=year(today())-1&&'Table'[quarter]=QUARTER(today()),"Y")
 
 
 pls see the attachment below




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

Proud to be a Super User!




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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