table DateTable
	lineageTag: db57fa20-d82e-4023-ba17-cac4037f3611

	column Date
		dataType: dateTime
		formatString: Long Date
		lineageTag: d98decd0-2696-433a-88ee-2ca4ff9d8cb7
		summarizeBy: none
		sourceColumn: Date

		annotation SummarizationSetBy = Automatic

		annotation UnderlyingDateTimeDataType = Date

	column Year
		dataType: int64
		formatString: 0
		lineageTag: 0cfe0c90-1ba2-465a-9212-1d6b09b92fe0
		summarizeBy: sum
		sourceColumn: Year

		annotation SummarizationSetBy = Automatic

	column 'Start of Year'
		dataType: dateTime
		formatString: Long Date
		lineageTag: 4cbd9784-8def-4afe-9339-791bc7c87c65
		summarizeBy: none
		sourceColumn: Start of Year

		annotation SummarizationSetBy = Automatic

		annotation UnderlyingDateTimeDataType = Date

	column 'End of Year'
		dataType: dateTime
		formatString: Long Date
		lineageTag: b855b73c-b60b-4d22-b57d-3e40552a58b3
		summarizeBy: none
		sourceColumn: End of Year

		annotation SummarizationSetBy = Automatic

		annotation UnderlyingDateTimeDataType = Date

	column Month
		dataType: int64
		formatString: 0
		lineageTag: 099a528a-bc01-4cab-bb57-3ca4b7b3dbfb
		summarizeBy: sum
		sourceColumn: Month

		annotation SummarizationSetBy = Automatic

	column 'Start of Month'
		dataType: dateTime
		formatString: Long Date
		lineageTag: 264e4c8b-8352-4460-a8dd-942e45f07956
		summarizeBy: none
		sourceColumn: Start of Month

		annotation SummarizationSetBy = Automatic

		annotation UnderlyingDateTimeDataType = Date

	column 'End of Month'
		dataType: dateTime
		formatString: Long Date
		lineageTag: 7af52468-b417-4c86-915c-facff470e3d6
		summarizeBy: none
		sourceColumn: End of Month

		annotation SummarizationSetBy = Automatic

		annotation UnderlyingDateTimeDataType = Date

	column 'Days in Month'
		dataType: int64
		formatString: 0
		lineageTag: 17999afc-3e5f-4c04-8e18-c81d929c479e
		summarizeBy: sum
		sourceColumn: Days in Month

		annotation SummarizationSetBy = Automatic

	column Day
		dataType: int64
		formatString: 0
		lineageTag: fbd3bd63-5855-4594-a8d0-823b5757fec9
		summarizeBy: sum
		sourceColumn: Day

		annotation SummarizationSetBy = Automatic

	column 'Day Name'
		dataType: string
		lineageTag: 2719e079-e038-479b-85ae-092b6bab94a0
		summarizeBy: none
		sourceColumn: Day Name

		annotation SummarizationSetBy = Automatic

	column 'Day of Week'
		dataType: int64
		formatString: 0
		lineageTag: 3e9c7367-3b6b-4598-ac34-8accd5cf3b86
		summarizeBy: sum
		sourceColumn: Day of Week

		annotation SummarizationSetBy = Automatic

	column 'Day of Year'
		dataType: int64
		formatString: 0
		lineageTag: 220538d4-cbf4-42af-b9e4-3b24cda33c29
		summarizeBy: sum
		sourceColumn: Day of Year

		annotation SummarizationSetBy = Automatic

	column 'Month Name'
		dataType: string
		lineageTag: 41c97d05-d63a-4c65-ab78-8943129f361b
		summarizeBy: none
		sourceColumn: Month Name

		annotation SummarizationSetBy = Automatic

	column Quarter
		dataType: int64
		formatString: 0
		lineageTag: 906ce52f-8d38-4b90-b601-106b10ce2432
		summarizeBy: sum
		sourceColumn: Quarter

		annotation SummarizationSetBy = Automatic

	column 'Start of Quarter'
		dataType: dateTime
		formatString: Long Date
		lineageTag: b1d0122b-2020-43ee-8b69-c43549e2152d
		summarizeBy: none
		sourceColumn: Start of Quarter

		annotation SummarizationSetBy = Automatic

		annotation UnderlyingDateTimeDataType = Date

	column 'End of Quarter'
		dataType: dateTime
		formatString: Long Date
		lineageTag: 81b02432-28f0-4cb7-b5f2-3b1f76e04736
		summarizeBy: none
		sourceColumn: End of Quarter

		annotation SummarizationSetBy = Automatic

		annotation UnderlyingDateTimeDataType = Date

	column 'Week of Year'
		dataType: int64
		formatString: 0
		lineageTag: 3f5e3ffa-f059-4b63-b5c3-b21222061e0e
		summarizeBy: sum
		sourceColumn: Week of Year

		annotation SummarizationSetBy = Automatic

	column 'Week of Month'
		dataType: int64
		formatString: 0
		lineageTag: 1a9a93df-bd06-4983-8b1e-82602c4c7f99
		summarizeBy: sum
		sourceColumn: Week of Month

		annotation SummarizationSetBy = Automatic

	column 'Start of Week'
		dataType: dateTime
		formatString: Long Date
		lineageTag: db8ac3ef-4296-4e52-bb3e-2783e2cefa01
		summarizeBy: none
		sourceColumn: Start of Week

		annotation SummarizationSetBy = Automatic

		annotation UnderlyingDateTimeDataType = Date

	column 'End of Week'
		dataType: dateTime
		formatString: Long Date
		lineageTag: 70be90aa-1647-46f5-bfb4-8c35bd7b09f5
		summarizeBy: none
		sourceColumn: End of Week

		annotation SummarizationSetBy = Automatic

		annotation UnderlyingDateTimeDataType = Date

	column 'Fiscal Year'
		dataType: int64
		formatString: 0
		lineageTag: c3aac87c-5704-4ea9-b9cd-ab1a5a0680d5
		summarizeBy: sum
		sourceColumn: Fiscal Year

		annotation SummarizationSetBy = Automatic

	column 'Fiscal Quarter'
		dataType: int64
		formatString: 0
		lineageTag: 5d0376e8-8659-4098-ba42-0b9e3fa299ca
		summarizeBy: sum
		sourceColumn: Fiscal Quarter

		annotation SummarizationSetBy = Automatic

	column 'Fiscal Month'
		dataType: int64
		formatString: 0
		lineageTag: b04bfff3-04bd-468e-9a5e-50f2de2c54e0
		summarizeBy: sum
		sourceColumn: Fiscal Month

		annotation SummarizationSetBy = Automatic

	column 'Day Offset'
		dataType: int64
		formatString: 0
		lineageTag: 3dbb41be-d731-4dda-a945-de08a9d4a5f1
		summarizeBy: sum
		sourceColumn: Day Offset

		annotation SummarizationSetBy = Automatic

	column 'Month Offset'
		dataType: int64
		formatString: 0
		lineageTag: 0cd882a6-cd39-44d3-a16c-bdd812efe2ed
		summarizeBy: sum
		sourceColumn: Month Offset

		annotation SummarizationSetBy = Automatic

	column 'Year Offset'
		dataType: int64
		formatString: 0
		lineageTag: 75622abb-60c8-4aca-ad97-e1ee78ffe0e8
		summarizeBy: sum
		sourceColumn: Year Offset

		annotation SummarizationSetBy = Automatic

	column 'Quarter Offset'
		dataType: int64
		formatString: 0
		lineageTag: 105fc668-8bba-49f4-bbfd-997c13df3393
		summarizeBy: sum
		sourceColumn: Quarter Offset

		annotation SummarizationSetBy = Automatic

	column Year-Month
		dataType: string
		lineageTag: b327c1c5-3894-4fdc-ba2d-9b0c922c7391
		summarizeBy: none
		sourceColumn: Year-Month

		annotation SummarizationSetBy = Automatic

	column 'Year-Month Code'
		dataType: int64
		formatString: 0
		lineageTag: f7a11837-f04c-4671-b6f9-ab39f28fafe2
		summarizeBy: count
		sourceColumn: Year-Month Code

		annotation SummarizationSetBy = Automatic

	partition DateTable = m
		mode: import
		source =
				let
				    // configurations start
				    Today=Date.From(DateTime.LocalNow()), // today's date
				    FromYear = 2005, // set the start year of the date dimension. dates start from 1st of January of this year
				    ToYear=2023, // set the end year of the date dimension. dates end at 31st of December of this year
				    StartofFiscalYear=1, // set the month number that is start of the financial year. example; if fiscal year start is July, value is 7
				    firstDayofWeek=Day.Sunday, // set the week's start day, values: Day.Monday, Day.Sunday....
				    // configuration end
				    FromDate=#date(FromYear,1,1),
				    ToDate=#date(ToYear,4,1),
				    Source=List.Dates(
				        FromDate,
				        Duration.Days(ToDate-FromDate)+1,
				        #duration(1,0,0,0)
				    ),
				    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
				    #"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Date"}}),
				    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}}),
				    #"Inserted Year" = Table.AddColumn(#"Changed Type", "Year", each Date.Year([Date]), Int64.Type),
				    #"Inserted Start of Year" = Table.AddColumn(#"Inserted Year", "Start of Year", each Date.StartOfYear([Date]), type date),
				    #"Inserted End of Year" = Table.AddColumn(#"Inserted Start of Year", "End of Year", each Date.EndOfYear([Date]), type date),
				    #"Inserted Month" = Table.AddColumn(#"Inserted End of Year", "Month", each Date.Month([Date]), Int64.Type),
				    #"Inserted Start of Month" = Table.AddColumn(#"Inserted Month", "Start of Month", each Date.StartOfMonth([Date]), type date),
				    #"Inserted End of Month" = Table.AddColumn(#"Inserted Start of Month", "End of Month", each Date.EndOfMonth([Date]), type date),
				    #"Inserted Days in Month" = Table.AddColumn(#"Inserted End of Month", "Days in Month", each Date.DaysInMonth([Date]), Int64.Type),
				    #"Inserted Day" = Table.AddColumn(#"Inserted Days in Month", "Day", each Date.Day([Date]), Int64.Type),
				    #"Inserted Day Name" = Table.AddColumn(#"Inserted Day", "Day Name", each Date.DayOfWeekName([Date]), type text),
				    #"Inserted Day of Week" = Table.AddColumn(#"Inserted Day Name", "Day of Week", each Date.DayOfWeek([Date],firstDayofWeek), Int64.Type),
				    #"Inserted Day of Year" = Table.AddColumn(#"Inserted Day of Week", "Day of Year", each Date.DayOfYear([Date]), Int64.Type),
				    #"Inserted Month Name" = Table.AddColumn(#"Inserted Day of Year", "Month Name", each Date.MonthName([Date]), type text),
				    #"Inserted Quarter" = Table.AddColumn(#"Inserted Month Name", "Quarter", each Date.QuarterOfYear([Date]), Int64.Type),
				    #"Inserted Start of Quarter" = Table.AddColumn(#"Inserted Quarter", "Start of Quarter", each Date.StartOfQuarter([Date]), type date),
				    #"Inserted End of Quarter" = Table.AddColumn(#"Inserted Start of Quarter", "End of Quarter", each Date.EndOfQuarter([Date]), type date),
				    #"Inserted Week of Year" = Table.AddColumn(#"Inserted End of Quarter", "Week of Year", each Date.WeekOfYear([Date],firstDayofWeek), Int64.Type),
				    #"Inserted Week of Month" = Table.AddColumn(#"Inserted Week of Year", "Week of Month", each Date.WeekOfMonth([Date],firstDayofWeek), Int64.Type),
				    #"Inserted Start of Week" = Table.AddColumn(#"Inserted Week of Month", "Start of Week", each Date.StartOfWeek([Date],firstDayofWeek), type date),
				    #"Inserted End of Week" = Table.AddColumn(#"Inserted Start of Week", "End of Week", each Date.EndOfWeek([Date],firstDayofWeek), type date),
				    FiscalMonthBaseIndex=13-StartofFiscalYear,
				    adjustedFiscalMonthBaseIndex=if(FiscalMonthBaseIndex>=12 or FiscalMonthBaseIndex<0) then 0 else FiscalMonthBaseIndex,
				    #"Added Custom" = Table.AddColumn(#"Inserted End of Week", "FiscalBaseDate", each Date.AddMonths([Date],adjustedFiscalMonthBaseIndex)),
				    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"FiscalBaseDate", type date}}),
				    #"Inserted Year1" = Table.AddColumn(#"Changed Type1", "Year.1", each Date.Year([FiscalBaseDate]), Int64.Type),
				    #"Renamed Columns1" = Table.RenameColumns(#"Inserted Year1",{{"Year.1", "Fiscal Year"}}),
				    #"Inserted Quarter1" = Table.AddColumn(#"Renamed Columns1", "Quarter.1", each Date.QuarterOfYear([FiscalBaseDate]), Int64.Type),
				    #"Renamed Columns2" = Table.RenameColumns(#"Inserted Quarter1",{{"Quarter.1", "Fiscal Quarter"}}),
				    #"Inserted Month1" = Table.AddColumn(#"Renamed Columns2", "Month.1", each Date.Month([FiscalBaseDate]), Int64.Type),
				    #"Renamed Columns3" = Table.RenameColumns(#"Inserted Month1",{{"Month.1", "Fiscal Month"}}),
				    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns3",{"FiscalBaseDate"}),
				    #"Inserted Age" = Table.AddColumn(#"Removed Columns", "Age", each [Date]-Today, type duration),
				    #"Extracted Days" = Table.TransformColumns(#"Inserted Age",{{"Age", Duration.Days, Int64.Type}}),
				    #"Renamed Columns4" = Table.RenameColumns(#"Extracted Days",{{"Age", "Day Offset"}}),
				    #"Added Custom1" = Table.AddColumn(#"Renamed Columns4", "Month Offset", each (([Year]-Date.Year(Today))*12)
				+([Month]-Date.Month(Today))),
				    #"Changed Type2" = Table.TransformColumnTypes(#"Added Custom1",{{"Month Offset", Int64.Type}}),
				    #"Added Custom2" = Table.AddColumn(#"Changed Type2", "Year Offset", each [Year]-Date.Year(Today)),
				    #"Changed Type3" = Table.TransformColumnTypes(#"Added Custom2",{{"Year Offset", Int64.Type}}),
				    #"Added Custom3" = Table.AddColumn(#"Changed Type3", "Quarter Offset", each (([Year]-Date.Year(Today))*4)
				+([Quarter]-Date.QuarterOfYear(Today))),
				    #"Changed Type4" = Table.TransformColumnTypes(#"Added Custom3",{{"Quarter Offset", Int64.Type}}),
				    #"Added Custom4" = Table.AddColumn(#"Changed Type4", "Year-Month", each Date.ToText([Date],"MMM yyyy")),
				    #"Added Custom5" = Table.AddColumn(#"Added Custom4", "Year-Month Code", each Date.ToText([Date],"yyyyMM")),
				    #"Changed Type5" = Table.TransformColumnTypes(#"Added Custom5",{{"Year-Month", type text}, {"Year-Month Code", Int64.Type}}),
				    #"Filtered Rows" = Table.SelectRows(#"Changed Type5", each true)
				in
				    #"Filtered Rows"

	annotation PBI_NavigationStepName = Navigation

	annotation PBI_ResultType = Table

