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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Thag
Regular Visitor

Conditional Column with values for fiscal year date ranges

Trying to add a column using power query to label fiscal years as FY1, FY2, etc. but when the start date and end dates are in the middle of the month. Example: 9/25/2023-9/24/2024 is FY1

1 ACCEPTED SOLUTION
tharunkumarRTK
Super User
Super User

@Thag 

Table.AddColumn(TableName, "FiscalYearLabel", each 
         if [StartDate] >= #date(2023,9, 25  ) && [EndDate] <= #date(2024,9,24 ) then
            "FY1" else ""
    )

 

Incase if your financial year calculation invlolves any logic then please share it here to help you better.

For example if your financial year depends on current year then 

let
    Source = Excel.CurrentWorkbook(){[Name="YourTableName"]}[Content],
    

    FiscalStartFY1 = #date(2023, 9, 25),
    

    AddFY = Table.AddColumn(Source, "FiscalYearLabel", each 
        let
            CurrentDate = [YourDateColumn],
            FiscalYearNumber = Number.IntegerDivide(Duration.Days(CurrentDate - FiscalStartFY1), 365) + 1
        in
            "FY" & Text.From(FiscalYearNumber)
    )
in
    AddFY

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

View solution in original post

5 REPLIES 5
v-csrikanth
Community Support
Community Support

Hi @Thag 

It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered?
If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!

Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

Hi @Thag 

We haven't heard from you since last response and just wanted to check whether the solution provided has worked for you. If yes, please Accept as Solution to help others benefit in the community.
Thank you.

If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

Hi @Thag 

Thank you for being part of the Microsoft Fabric Community.

As highlighted by @tharunkumarRTK , the proposed approach appears to effectively address your requirements. Could you please confirm if your issue has been resolved?
If you are still facing any challenges, kindly provide further details, and we will be happy to assist you.

Best Regards,
Community Support Team _ C Srikanth.

danextian
Super User
Super User

Hi @Thag 

 

but when the start date and end dates are in the middle of the month? Your statement seems to be lacking. can you  please give us a full example? What about for the other dates?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
tharunkumarRTK
Super User
Super User

@Thag 

Table.AddColumn(TableName, "FiscalYearLabel", each 
         if [StartDate] >= #date(2023,9, 25  ) && [EndDate] <= #date(2024,9,24 ) then
            "FY1" else ""
    )

 

Incase if your financial year calculation invlolves any logic then please share it here to help you better.

For example if your financial year depends on current year then 

let
    Source = Excel.CurrentWorkbook(){[Name="YourTableName"]}[Content],
    

    FiscalStartFY1 = #date(2023, 9, 25),
    

    AddFY = Table.AddColumn(Source, "FiscalYearLabel", each 
        let
            CurrentDate = [YourDateColumn],
            FiscalYearNumber = Number.IntegerDivide(Duration.Days(CurrentDate - FiscalStartFY1), 365) + 1
        in
            "FY" & Text.From(FiscalYearNumber)
    )
in
    AddFY

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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