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
M_SBS_6
Helper V
Helper V

Flag to show current and previous FY

Hi, 

I have a financial year column which outputs the financial year of the record we store (e.g FY21/22)

 

The financial year runs from 1st September to 31st August.

 

What I'd like, if possible, is to have a flag that outputs "current fy" and "previous fy" based on the date range above.

 

So, as of today, FY20/21 will show "previous fy" and FY21/22 will show "current fy".

 

And when we move to 1st September 2022, that will show as "current fy" and FY21/22 will change to show "previous fy" and FY20/21 will then show as "blank".

1 ACCEPTED SOLUTION
Hoangechip910
Frequent Visitor

We need 2 date marks: start_of_currentFY and start_of_previousFY to define flag

 

measure start_of_currentFY = 

if (MONTH(TODAY()) in {9,10,11,12}, DATE(YEAR(TODAY()),9,1),DATE(YEAR(TODAY())-1,9,1))
measure start_of_previousFY
if (MONTH(TODAY()) in {9,10,11,12}, DATE(YEAR(TODAY()-1),9,1),DATE(YEAR(TODAY())-2,9,1))
 
then we make comparasion to define flag in data table:
 
column Flag = if ( Date >= start_of_currentFY, "CurrentFY",if ( Date >= start_of_previousFY,"Previous FY", blank()))

View solution in original post

2 REPLIES 2
Hoangechip910
Frequent Visitor

We need 2 date marks: start_of_currentFY and start_of_previousFY to define flag

 

measure start_of_currentFY = 

if (MONTH(TODAY()) in {9,10,11,12}, DATE(YEAR(TODAY()),9,1),DATE(YEAR(TODAY())-1,9,1))
measure start_of_previousFY
if (MONTH(TODAY()) in {9,10,11,12}, DATE(YEAR(TODAY()-1),9,1),DATE(YEAR(TODAY())-2,9,1))
 
then we make comparasion to define flag in data table:
 
column Flag = if ( Date >= start_of_currentFY, "CurrentFY",if ( Date >= start_of_previousFY,"Previous FY", blank()))

Thank you so much for your help, I really do appreciate it. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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