Fiscal Year Help Wanted

kaia2001

New member
Joined
Sep 5, 2018
Messages
9
Reaction score
0
Points
0
Excel Version(s)
Office Standard 2013
Hi all,

I am in a serious quandary! I have searched the internet and I cannot locate a clear solution to adding a column (or multiple columns) in Power Query that will calculate the Year, Quarter, Month, Week according to our clients fiscal year. I have created a dashboard according to the calendar year however I need to alter the visuals to display the data in alignment with their FY. The rules of their calendar are as follows.


  1. First day of the FY is July 1st, 2018
  2. First week of the Fiscal week is the week containing July 1st (for their 2019 FY it is May 25, 2019 -July 1, 2018)
  3. Monday is the beginning of the week
  4. They are on a 445 calendar


Please if anyone can shine light on this or at least get me off to a goo start I would greatly appreciate it.
 
Start your calendar from the first day of your fiscal year. You then need to add a bunch of PeriodID columns:
DayID:
  • Add an Index Column from 1
YearID:
  • Add a Custom Column with this formula:
Code:
=Number.RoundUp([DayID]/364)
QuarterID:
  • Add a Custom Column with this formula:
Code:
=Number.RoundUp([DayID]/91)​
MonthID:
  • Add a Custom Column with this formula:
Code:
=Number.RoundDown([DayID]/91)*3+​
( if Number.Mod([DayID],91)=0 then 0​
  else if Number.Mod([DayID],91)<=28 then 1 ​
  else if Number.Mod([DayID],91)<=56 then 2​
  else 3​
)​
WeekID:

  • Add a Custom Column with this formula:
Code:
Number.RoundUp([DayID]/7)​

You should also create a single query that drills down to the first day and call it StartDate (need to be a data point, not a table). Then you can get the pieces you need with other custom columns like this:

Code:
Fiscal Year:   =Date.Year(Date.From(StartDate))+[YearID]
Month of Year:     =Number.Mod([MonthOfYear]-1,3)+1

Basically, once you know the PeriodID, you can use that to add/subtract shift the data in the Date column as needed.
 
Start your calendar from the first day of your fiscal year. You then need to add a bunch of PeriodID columns:
DayID:
  • Add an Index Column from 1
YearID:
  • Add a Custom Column with this formula:
Code:
=Number.RoundUp([DayID]/364)
QuarterID:
  • Add a Custom Column with this formula:
Code:
=Number.RoundUp([DayID]/91)​
MonthID:
  • Add a Custom Column with this formula:
Code:
=Number.RoundDown([DayID]/91)*3+​
( if Number.Mod([DayID],91)=0 then 0​
  else if Number.Mod([DayID],91)<=28 then 1 ​
  else if Number.Mod([DayID],91)<=56 then 2​
  else 3​
)​
WeekID:

  • Add a Custom Column with this formula:
Code:
Number.RoundUp([DayID]/7)​

You should also create a single query that drills down to the first day and call it StartDate (need to be a data point, not a table). Then you can get the pieces you need with other custom columns like this:

Code:
Fiscal Year:   =Date.Year(Date.From(StartDate))+[YearID]
Month of Year:     =Number.Mod([MonthOfYear]-1,3)+1

Basically, once you know the PeriodID, you can use that to add/subtract shift the data in the Date column as needed.


Thank you Ken so much!!

I have one question. The data set we have began on 5/14/2018 being as the first day of the FY begins on 5/25/2018 is there anyway to include those 11 days of info without adding columns for the previous year to assign the ID starting with the first date? Are my only 2 options to add 353 rows of empty data to start with the 2018 FY or to eliminate those 11 days of data?

Kay
 
Thats ok, I answered my own question. i started the Index Column at 323 which will finish off the previous FY and start the current FY at May 25th 2018 with an Index number of 365 thus rounding up to 2! Thank you again!!!!
 
2 things:

1. With the Qtr's being assign and starting with the last quarter of the previous year how do I assign Qtrs 1-4 to the DATA instead of 4-8 that are showing now for the 'QuarterID"
2. I continue to receive an error for the MonthID below I have replaced the day ID withe the Index column however I can't figure out why it isn't working.
PQ Error.png
 
Back
Top