Forum Discussion

christinaxxx's avatar
christinaxxx
Helper I
2 years ago
Solved

Getting wrong quarter in the date table

I have a calendar function for generating date table in Power Query: = (StartDate as date, EndDate as date, FYStartMonth as number) as table => let DayCount = Duration.Days(Duration.From(EndD...
  • andhiii079845's avatar
    2 years ago

    You are welcome! ๐Ÿ™‚ 
    Yes you have to add it. You can use the same code but you have to change  "shortyear" to "QuarterOfYear"

        AddFY = Table.AddColumn(InsertShortYear, "FY", each "FY"&(if [MonthOfYear]>=FYStartMonth then Text.From(Number.From([ShortYear])+1) else [ShortYear]))

     --> like something like this. 

        AddFY = Table.AddColumn(InsertShortYear, "FY", each "FY"&(if [MonthOfYear]>=FYStartMonth then Text.From(Number.From([QuarterOfYear])+1) else [QuarterOfYear]))

    Let me know if you need more help.