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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
CYParker
Advocate II
Advocate II

Financial Year via nested if formula

Just wanted to share this, as I was finding a lot of what appeared to be very complex (to me at least) solutions for something pretty simple - displaying the financial year, in a format of choice, based on a date.

 

Steps:

  1. Open the Query Editor
  2. Select the query that you want to add the financial year column to
  3. Add a new custom column
  4. Use the below nested if statement as the Custom column formula
    • Adjust the #date(yyyy,m,d) values and financial year string "20yy-yy" as required.
    • Replace [doc_startdate] with the name of your date column (past the code into Word and do a find and replace)

if [doc_startdate] = null then "" else if [doc_startdate] < #date(2020,7,1) then "2019-20" else if [doc_startdate] < #date(2021,7,1) then "2020-21" else if [doc_startdate] < #date(2022,7,1) then "2021-22" else if [doc_startdate] < #date(2023,7,1) then "2022-23" else if [doc_startdate] < #date(2024,7,1) then "2023-24" else "ERROR"

Done!

 

Hope that it helps someone 🙂

0 REPLIES 0

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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors