Posts

Showing posts with the label power query

Create Calendar Table with Power Query

Image
How to create calendar table by using power query Step 1: Click on Get Data Step 2: Select Blank Query Step 3: Click on Advance Editor in the Home Tab of Power Query Editor Step 4: Remove the syntax and paste below mentioned syntax Syntax: Paste below mentioned syntax let     StartDate = #date(2024, 1, 1),     EndDate = #date(2024, 12, 31),     NumberOfDays = Duration.Days(EndDate - StartDate),     DateList = List.Dates(StartDate, NumberOfDays+1, #duration(1, 0, 0, 0)),     TableFromList = Table.FromList(DateList, Splitter.SplitByNothing()) in     TableFromList If you want a calendar for a different range, modify the StartDate and EndDate variables accordingly. Step 5: Click "Done" in the Advanced Editor. Step 6: You may want to add additional columns to your calendar table, such as Year, Month, Quarter, Day of Week, etc. Here's an example of how to add a Year column: In Power Query Editor, select the "Date" column. Go to th...