Convert Dates to Fiscal Periods with Power Query - Better than Formulas!

  Рет қаралды 64,449

MyOnlineTrainingHub

MyOnlineTrainingHub

Күн бұрын

It's more efficient for Excel to add columns for your fiscal periods with Power Query than it is with formulas. In this video I'll cover both fiscal periods that start at the beginning of a month and those, like a 4-5-4 calendar, that don’t.
Download the Excel file here: www.myonlinetr...
Learn Power Query: www.myonlinetr...
View my comprehensive courses: www.myonlinetr...
Connect with me on LinkedIn: / myndatreacy

Пікірлер: 95
@peterbartholomew7409
@peterbartholomew7409 4 жыл бұрын
As always I enjoyed your video and agree that the best time for cleaning and sorting data is before it ever gets to the Excel workbook. That said, I wouldn't regard the processing involved in Power Query as in any way trivial. I am not sure that a user that struggles with a VLOOKUP is going to do so much better distinguishing their left outer join from an inner join. You are now so familiar with the environment that you handle the advanced editor with flair and fluency but I assure you I am far more laboured. For the Aussie FY, I reverted to a single formula = LET( oldFY?, MONTH(date) < MONTH(startFY), FiscalMonth, 1 + MONTH(date) - MONTH(startFY) + 12*oldFY?, Quarter, 1 + QUOTIENT( FiscalMonth-1, 3 ), FY, YEAR(date) - oldFY?, CHOOSE({1,2,3}, FiscalMonth, Quarter, FY ) ) It just got me to the point of deciding that accountancy and tax are incomprehensible. In the UK our fiscal year starts on 6 April, so how many days are there in March? Or is April 3 part of month 13?
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Thanks for watching, Peter! I didn't mean that Power Query was easier for the user, I meant it was easier for Excel to calculate in Power Query before loading to Excel. I obviously didn't make that clear! Thanks for sharing your LET solution. Can't say I've ever used QUOTIENT...I usually just use INT the function, so will have to keep it in mind for future.
@Metzanine
@Metzanine 2 жыл бұрын
I seem to remember getting fiscal years by using parameters in power query. Much quicker and easier, but not dynamic. But if you list out several years into the future that's not a problem 😊
@MyOnlineTrainingHub
@MyOnlineTrainingHub 2 жыл бұрын
Thanks for sharing!
@2_Bike_is_Life
@2_Bike_is_Life 4 жыл бұрын
Why didn't I have this video 2 weeks ago when I needed it! So awesome.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Better late than never :-)
@grahamparker7729
@grahamparker7729 4 жыл бұрын
Love your tutorials Mynda, keep up the great work 👍🏻
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Thanks so much, Graham!
@alexsonga4742
@alexsonga4742 3 жыл бұрын
Another amazing tutorial.God bless you Mynda for sharing.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 3 жыл бұрын
Thank you! 😊
@IvanCortinas_ES
@IvanCortinas_ES 4 жыл бұрын
Fantastic Mynda. All doubts resolved! Thank you!!!
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Glad it was helpful, Ivan!
@ammarwasif5337
@ammarwasif5337 2 жыл бұрын
This is exactly what I was looking for...thanks for the video
@MyOnlineTrainingHub
@MyOnlineTrainingHub 2 жыл бұрын
Glad I could help!
@johnandrawous7617
@johnandrawous7617 Жыл бұрын
This was wonderful and easy to follow. Thanks so much!
@MyOnlineTrainingHub
@MyOnlineTrainingHub Жыл бұрын
Glad it was helpful!
@mandywu-5fttalladventure
@mandywu-5fttalladventure 6 ай бұрын
Mynda, thanks for the awesome tutorial. I do have a more complex question. How would one solve the fiscal calendar problem when it is a moving target? Here's an example using 2024 calendar, a company's fiscal year starts in Feb and each quarter consist of 13 (4+4+5 weeks) + 1 weeks. The one week is overlapped between quarters. So say, if we are in Feb/Q1, that quarter would start on 1/29/24 (week 1) and ends 5/5/24 (week 14). Next quarter, Q2, it starts on 4/29/24 (week 14) and ends 8/4/24 (Week 27) and so forth.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 6 ай бұрын
Hi Mandy, Please post your question and sample Excel file on our forum where someone can help you further: www.myonlinetraininghub.com/excel-forum
@gheorghebidiac2975
@gheorghebidiac2975 4 жыл бұрын
Very impressive, as always! Keep up the good work!
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Thanks, will do :-)
@KimCryns
@KimCryns 9 күн бұрын
Again, Amazing information and explanation. What is the correct order for the quarters if your fiscal year starts in April? I have Month is greater than or... 10 Q3, 7 Q2, 4 Q1 else Q4. Only the first 3 months are in one year from the budget tab, the rest are in the following year. (I have changed the FY to < 4).
@MyOnlineTrainingHub
@MyOnlineTrainingHub 9 күн бұрын
You can use this formula: =IF(MONTH([@Date])
@KimCryns
@KimCryns 9 күн бұрын
@@MyOnlineTrainingHub Thank you. I am a little lost. Tried this formula in PQ custom column, fiscal year. I could not seem to get it to work. I tweaked it here and there but no luck unfortunately. :-) This was my previous attempt. = if [Month] < 4 then Text.End(Number.ToText([Year]),4) else Text.End(Number.ToText([Year]+1),4)
@excelhouse831
@excelhouse831 4 жыл бұрын
Power Query is best for such date transformation. Thanks for sharing content.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Glad you agree, Lalit :-)
@dennisBZC
@dennisBZC 6 ай бұрын
Hi Mynda, your videos are really good and I’m so grateful for you to share your knowledge. I have seen examples with year() + month() instead of PowerQuery, which I’m not familiar with. I am not even sure I know how to find it. Doesn’t help when Mac version of Excel uses different commands even when it is still Microsoft 365. But on this, how would you tighten the filter to get the tax year based on days, rather than just months. For example, UK fiscal years go from 6/4/2024 to 5/4/2025? I would be v grateful if you could explain that.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 6 ай бұрын
Ah, yes, Power Query is not really available to for Mac. I say 'not really' because it's still under development so functionality is limited. See this video on formulas for fiscal years: kzbin.info/www/bejne/oIKUnWSZptKdbbs And if you want to use Slicers, then this video: kzbin.info/www/bejne/sGOlkKqDar-SmKc
@peterbartholomew7409
@peterbartholomew7409 4 жыл бұрын
Hi Mynda. I have some words to eat! I worked through the Power Query and was fascinated by the way you used the outer join to combine two dissimilar datasets in order to achieve the equivalent of an approximate lookup. I would have claimed that ordered lists such as time sequences should be treated as array problems and not list processing, yet you managed the task with some elegance! That said, INDEX/XMATCH returned all the values with a single array, XLOOKUP was elegant if one is prepared to accept a single row formula copied down. The next shock for me was that VLOOKUP, a function that I have despised for years, also did a pretty good job = VLOOKUP(Table2[@Date], Periods_454, {1,2,3,4}) How am I supposed to hang on to my prejudices when you insist on demonstrating other possibilities? :-)
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
:-D love the VLOOKUP solution, Peter! I love that there are so many ways to solve challenges in Excel. We're only limited by our imagination.... and knowledge.
@alexsonga4742
@alexsonga4742 4 жыл бұрын
Another amazing tutorial.Thank you Mynda.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Thanks so much, Alex!
@wayneedmondson1065
@wayneedmondson1065 4 жыл бұрын
Hi Mynda. Awesome tutorial.. as always. Thanks for sharing your great knowledge! Thumbs up!!
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Thanks so much, Wayne!
@DougHExcel
@DougHExcel 4 жыл бұрын
PQ is great for these date transformations!
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Glad you agree, Doug!
@Orions_Journey
@Orions_Journey Жыл бұрын
Great video, what if i want the fiscal year to say FY-20 instead of FY19/20?
@MyOnlineTrainingHub
@MyOnlineTrainingHub Жыл бұрын
You can use this code in the Power Query technique: = if [Month] < 7 then "FY-" & Text.End(Number.ToText([Year]),2) else "FY-" & Text.End(Number.ToText([Year]+1),2)
@richardberry4462
@richardberry4462 3 жыл бұрын
Hi Mynda, this is exactly what I have been looking for. If I use these to create a model for my users, will they need Power query enabled to use it?
@MyOnlineTrainingHub
@MyOnlineTrainingHub 3 жыл бұрын
Great to hear, Richard! Power Query is enabled by default in Excel 2013 onward. However, they don't need to use Power Query once you've loaded the data to the Excel worksheet or Power Pivot.
@heikoheimrath7514
@heikoheimrath7514 4 жыл бұрын
Very good video, Mynda - Have a great weekend - Greetings from Germany
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Thanks so much, Heiko! Hope you’re having a great weekend too 😊
@patrickrafidimanantsoa2297
@patrickrafidimanantsoa2297 4 жыл бұрын
Awesome! Exactly what I needed! Thank you so much!
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Pleased to hear that, Patrick!
@lucasmendoncaoficial
@lucasmendoncaoficial 2 жыл бұрын
congrat... you save me!!! Brazil appreciated!!...
@MyOnlineTrainingHub
@MyOnlineTrainingHub 2 жыл бұрын
So glad I could help, Lucas!
@darrylmorgan
@darrylmorgan 4 жыл бұрын
Hi Mynda!Great Tutorial,Really Helpful Tips...Thank You :)
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Great to hear, Darryl! Thanks :-)
@imalkamadhushani4701
@imalkamadhushani4701 2 жыл бұрын
Hi Miranda, this is very informative. Always loved watching your videos. Can you please let me know how I can create the week number in power query where week 1 starts in 1st July?
@MyOnlineTrainingHub
@MyOnlineTrainingHub 2 жыл бұрын
Thank you! See this post for fiscal weeks: community.powerbi.com/t5/Desktop/Custom-Fiscal-Year-Calendar/m-p/85228
@shauncoombe1951
@shauncoombe1951 4 жыл бұрын
Hi Mynda, your tutorials are just on another level. That said I'm trying to achieve something a little unique and does not quite fit into the boxes of the tutorials you've given or I simply don't know how to apply them correctly...probably the latter. Can you tell me if you offer private hours and if so could you advise what you need in return? Please accept my apologies for this public request but I did not have any other contact options available to me.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Hi Shaun, so pleased you're enjoying my tutorials. Please post your question and sample Excel file on our forum where we can help you further: www.myonlinetraininghub.com/excel-forum
@beautifulmercy3
@beautifulmercy3 2 жыл бұрын
Hi Mynda, Thank you for the easy to follow tutorial. Question, on the 454 method, is there a way to extract fiscal months?
@MyOnlineTrainingHub
@MyOnlineTrainingHub 2 жыл бұрын
You'd have to add them to the lookup table.
@beautifulmercy3
@beautifulmercy3 2 жыл бұрын
@@MyOnlineTrainingHub, thank you for responding :) I run into another problem. So my company's 445 calendar is a bit odd, in that our months don't end on the last days of the calendar month except for December. Our calendar is more like a 345 (for the first quarter), 445 for the second and third quarter, and 446 for the last quarter. How would I create a calendar with such a scenario? Thank you very much for your help.
@dataengineers5945
@dataengineers5945 4 жыл бұрын
Got lost from 3:16-4:20 but will keep up rechecking. Thank you
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Here's a tutorial on writing 'if' statements in Power Query that will hopefully help: www.myonlinetraininghub.com/power-query-if-statements
@chrism9037
@chrism9037 4 жыл бұрын
Very cool Mynda!
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Cheers, Chris :-)
@Ola-iu6zc
@Ola-iu6zc Жыл бұрын
Hi Mynda, this will solve my UK calendar issue which starts in April and ends in March. My question is how do I sort my table to start from April and not January. Thanks.
@MyOnlineTrainingHub
@MyOnlineTrainingHub Жыл бұрын
Awesome to hear. The sorting video is coming out next week! 😉
@Ola-iu6zc
@Ola-iu6zc Жыл бұрын
Thanks
@terrydonoghue677
@terrydonoghue677 4 жыл бұрын
Great tutorial Mynda - Thanks. BTW do you know if is it possible to calculate age (in years) in Power Query that correctly accounts for leap years (like DATEDIFF)?
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Thanks, Terry! Power Query correctly calculates the number of days between dates for leap years. You'd then need to convert that to years, as it doesn't have this option in the 'age' calculation.
@terrydonoghue677
@terrydonoghue677 4 жыл бұрын
@@MyOnlineTrainingHub Thanks for your response Mynda , that’s what I thought. Somewhat confusing, I think, to have an ‘age’ calculation in Power Query that doesn’t return an accurate result. Keep up the great tutorials 👍
@sets4life769
@sets4life769 Жыл бұрын
Great video, realy helpful, I have one question, if we want to have fiscal year 2022/2023 instead of FY22/2023, what do i need to change, i tried a few things but always showing an error as token Eof Expected
@MyOnlineTrainingHub
@MyOnlineTrainingHub Жыл бұрын
Replace the formula in the step called 'Added Conditional Column2' to this: = Table.AddColumn(#"Added Conditional Column1", "Fiscal Year", each if [Month] < 7 then Text.End(Number.ToText([Year]-1),4) & "/" & Text.End(Number.ToText([Year]),4) else Text.End(Number.ToText([Year]),4) & "/" & Text.End(Number.ToText([Year]+1),4))
@krishck8552
@krishck8552 4 жыл бұрын
Thank you very much for your videos. Is there a way to reduce files size using power query? I am having trouble to share 100mb files
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
My pleasure, Krish! You can use Power Query to eliminate data you don't need in your file before importing. You can also load the data from Power Query to Power Pivot, which is typically more efficient than loading the data into the Excel grid. From Power Pivot you can create PivotTables to analyse and summarise your data. More on Power Pivot here: www.myonlinetraininghub.com/power-pivot-course
@eminado3013
@eminado3013 3 жыл бұрын
Great video! Thank you.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 3 жыл бұрын
Glad you liked it!
@hazemali382
@hazemali382 4 жыл бұрын
Many Thanks Mrs. Mynda ♥
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
You're welcome, Hazem!
@hazemali382
@hazemali382 4 жыл бұрын
​@@MyOnlineTrainingHub Many thanks for caring to Reply on us
@hazemali382
@hazemali382 4 жыл бұрын
@@MyOnlineTrainingHub Thanks Mynda ♥
@vishnuvardanatmakuri
@vishnuvardanatmakuri 3 жыл бұрын
Mynda, I have a question, my Purchase orders(PO) spread over financial years, mostly over two but a few of them for 3 , 4 or 5 years also, I want to calculate the number of dates each PO is active in each financial year and then accordingly assign spend to each year assuming spend is evenly spread for each day of the PO, please guide with this query.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 3 жыл бұрын
Please post your question and sample Excel file on our forum where we can help you further: www.myonlinetraininghub.com/excel-forum
@omut4981
@omut4981 3 жыл бұрын
Thank you kind lady, straya ftw
@MyOnlineTrainingHub
@MyOnlineTrainingHub 3 жыл бұрын
My pleasure, Omut!
@jerrydellasala7643
@jerrydellasala7643 4 жыл бұрын
Great technique & video! In the Periods_454 query, the Fiscal Qtr column data type was changed from Any to Whole Number, however if you then change the values in that table from numbers (1-4) to Quarters (Q1-Q4), the query has an error. Removing "{"Fiscal Qtr", type text}" returns the column data type to "any" which allows it to be a number if no Q is present, or text when there is. Changing the data type to Text forces a single digit entry to be loaded as Text.
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Cheers, Jerry. In the Periods_454 query you can change the data type to 'type text' for the Fiscal Quarter column, but if you're not confident in editing the M code, you may find it easier to add the Qs to the quarters in the lookup table before loading, then the data type will correctly be formatted as text.
@skvska1234
@skvska1234 4 жыл бұрын
Excellent info..👍
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
So nice of you, Suresh!
@yes-pg5dy
@yes-pg5dy 3 жыл бұрын
Hi mam, in matrix visual based on the selection in the slicer I need to see the change in the column names(headers) dynamically.. can we achieve this by using Dax measure ?
@MyOnlineTrainingHub
@MyOnlineTrainingHub 3 жыл бұрын
Not sure I understand, but perhaps this is what you mean: www.myonlinetraininghub.com/change-pivottable-aggregation-methods-using-excel-slicers
@yes-pg5dy
@yes-pg5dy 3 жыл бұрын
@@MyOnlineTrainingHub tq mam for ur reply and I will go through the link u given... And by using this Dax measure I am getting current year previous month but my requirement is previous year same month Value in Matrix = IF ( SELECTEDVALUE('Table'[Date]) = DATE(YEAR(MAX('Slicer'[Date])),MONTH(MAX('Slicer'[Date]))-1,1), SUM ( 'Table'[Sales] ), BLANK () )
@scottstephens5225
@scottstephens5225 2 жыл бұрын
I know this is an old thread but does this custom column for FY handle more than one fiscal year of date data?
@MyOnlineTrainingHub
@MyOnlineTrainingHub 2 жыл бұрын
Yes, you can modify it for as many years as required.
@jaimalpatel1257
@jaimalpatel1257 4 жыл бұрын
HI mynda my formula is correct and when i click ok, i receive some errors saying "We cannot apply operator + to types Text and Number." (my formula is right though)
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Hi Jaimal, Power Query is type sensitive, which is why the error says it cannot apply operator + to types Text and Number. In other words, it cannot add a number to text. You need to check the data types for the fields you're wanting to add and fix them in the prior step, or fix them in the formula. If you're still stuck, please post your question and sample Excel file on our forum where we can help you further: www.myonlinetraininghub.com/excel-forum
@AccountingandQuickbooks
@AccountingandQuickbooks 4 жыл бұрын
👍👍👍
@MyOnlineTrainingHub
@MyOnlineTrainingHub 4 жыл бұрын
Thanks!
@chasingdogs
@chasingdogs 5 ай бұрын
I tried to do this and “token literal “expected comes up under “else”. Help!!
@MyOnlineTrainingHub
@MyOnlineTrainingHub 5 ай бұрын
It means the word 'else' is expected in an if statement e.g. if this is true then that else this
@fortuneforfuture
@fortuneforfuture 4 жыл бұрын
Complecates
Power Query Unpivot - fix 4 common data layouts (incl. workbook)
19:24
MyOnlineTrainingHub
Рет қаралды 231 М.
Say Goodbye to IF Statements in Excel with SWITCH
7:45
Teacher's Tech
Рет қаралды 561 М.
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 247 МЛН
Flipping Robot vs Heavier And Heavier Objects
00:34
Mark Rober
Рет қаралды 61 МЛН
А что бы ты сделал? @LimbLossBoss
00:17
История одного вокалиста
Рет қаралды 12 МЛН
How to easily automate boring Excel tasks with Power Query!
17:10
MyOnlineTrainingHub
Рет қаралды 1,6 МЛН
The Excel Functions Almost Everyone Overlooks (Better Than SUMIFS)
10:29
MyOnlineTrainingHub
Рет қаралды 65 М.
Everyone's Talking About This NEW Excel Function (TRIMRANGE)
9:29
MyOnlineTrainingHub
Рет қаралды 66 М.
Easily Fix Dates Formatted as Text with Power Query
12:48
MyOnlineTrainingHub
Рет қаралды 105 М.
Power Query Custom Data Types Revolutionize Data in Cells
12:18
MyOnlineTrainingHub
Рет қаралды 34 М.
The Excel Trick I Use EVERY DAY (and you should too!)
11:21
MyOnlineTrainingHub
Рет қаралды 192 М.
7 Advanced PivotTable Techniques That Feel Like Cheating
16:07
MyOnlineTrainingHub
Рет қаралды 72 М.
Stop Wasting Time! 3 Easy Ways to Remove Blank Rows in Excel
10:20
Leila Gharani
Рет қаралды 114 М.
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 247 МЛН