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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Cre8ive
New Member

Conditional Column with values for fiscal year date ranges

How do I create a conditional column with values for fiscal year date ranges "9/1/2011 to 8/31/2012"?

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Something like this:

if Date.Month([Column1]) < 9 then Date.Year([Column1]) else Date.Year([Column1]) + 1

Please check at your side because I just rushed it.

 

It's generally considered good practice to do this sort of thing in a date table and use a relationship to link to the data.  Plenty of resources out there. 

View solution in original post

4 REPLIES 4
HotChilli
Super User
Super User

Something like this:

if Date.Month([Column1]) < 9 then Date.Year([Column1]) else Date.Year([Column1]) + 1

Please check at your side because I just rushed it.

 

It's generally considered good practice to do this sort of thing in a date table and use a relationship to link to the data.  Plenty of resources out there. 

It worked, thank you!!!  Good to know, I will look into date tables.

HotChilli
Super User
Super User

Could you provide more detail please?  Do you want to add a column in Power Query according to a date in your data already? or something else?

Yes, in Power Query, I have a Transaction Date column and want to add a column that calculates Fiscal Year based on the transaction date ranges.

 

In Excel I used the formula below, I tried to replicate it in a Conditional Column and  then tried copying it into a Custom Column, neither worked.

 

=TEXT(YEAR([@[Transaction Date]])+IF(MONTH([@[Transaction Date]])>8,1,0),0)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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