Changing PeriodID to Fiscal periods

Reed9050

New Member
Joined
Aug 14, 2019
Messages
8
In Power Query I have a PeriodID column that starts at 1 and increases by 1 every 28 days, so each fiscal period has a unique number. I am trying to find a way to convert these numbers to periods, so it will repeat number 1 through 13 every year. Here is my current code:

Table.AddColumn(#"Added Custom7", "PeriodID", each if ([Index]>=2157 and [Index]<=2191) then 78 else Number.RoundDown(([Index]-1)/28)+1)
*P13 of 2017 has 5 weeks so I had to put the if statement in there.

Would it be easier to do this in power pivot? or is there a function that will allow me to "reset" count for each new fiscal year?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
The calendar goes back to 12/2/2012, the start of the 2012 fiscal year. The next fiscal year starts after 13 28-day periods have elapsed. Except for 2017, where P13 was a 35-day period. I have a unique ID column for the Fiscal year and the period, if there is a formula that causes loops the values between 1 and 13 I can get periods from the PeriodID column, Thanks.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,202
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top