This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
fnDateTable = ( StartDate as date, EndDate as date, optional FYStartMonthNum as number, optional Holidays as list, optional WDStartNum as number, optional AddRelativeNetWorkdays as logical ) as table => | |
let | |
FYStartMonth = List.Select({1..12}, each _ = FYStartMonthNum){0}? ?? 1, | |
WDStart = List.Select({0..1}, each _ = WDStartNum){0}? ?? 0, | |
CurrentDate = Date.From(DateTimeZone.FixedUtcNow()), | |
DayCount = Duration.Days(Duration.From(EndDate - StartDate)) + 1, | |
weekStart = Day.Monday, | |
HolidaysProvided = Holidays <> null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dateTableName = "Dates"; // Name of your date table | |
var dateKeyColName = "Date"; // Name of the date key column in the table | |
var colOperations = new List<Tuple<string, string, bool>>(){ | |
Tuple.Create("Quarter & Year", "QuarternYear", true), | |
Tuple.Create("Month & Year", "MonthnYear", true), | |
Tuple.Create("Month Name", "MonthOfYear", true), | |
Tuple.Create("Month Short", "MonthOfYear", true), | |
Tuple.Create("Month Initial", "MonthOfYear", true), | |
Tuple.Create("Week & Year", "WeeknYear", true), | |
Tuple.Create("Day of Week Name", "DayOfWeek", true), |
OlderNewer