Forum Discussion
Adding a date column
Please try this expression in your calculated column. It should count from 1 to today starting with the minimum date in the table. Note you will have duplicated values where you have duplicate days (so not really an "index").
Day Number = var mindate = MIN(Table[Created Date Time) // or you could hard code it with DATE(2018,4,3)
Return DATEDIFF(mindate, Table[Created Date Time], DAY) +1
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
Hi,
As mr Kimball says:
"To facilitate partitioning, the primary key of a date dimension can be more meaningful, such as an integer representing YYYYMMDD, instead of a sequentially-assigned surrogate key"
So go to modelling -> new table -> and insert the code I shared earlier.