Forum Discussion
Auto Date/Time and Mark As Date Table issues
I'm having some weirdness with dates in Fabric models.
Firstly, I've got a bunch of different date columns in Fabric that Power BI is not detecting automatically as Dates when connecting to the model with a Live connection. When I download a local copy of the data and ingest it into Power BI from Excel it correctly flags the fields as dates and adds a hierarchy.
Since I wasn't able to fix the above issue, I then moved on to trying to create a single Date table and then join that to the dates. I've got a table but for some reason the option to Mark As Date Table is greyed out in Fabric, but if I create a local copy of the model I can correctly convert the table to a Date table. I've tried in lakehouse, warehouse, and datamart, and same problem in each.
Has anyone had similar issues with dates not being recognised?
Fabric Model;Fabric Model
Local Copy of Same Model;Local Copy
The date table itself should be fine, it's just using the code below;
let
Source = List.Dates(#date(1900,01,01), 365*200, #duration(1,0,0,0)),
#"Converted to table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed column type with locale" = Table.TransformColumnTypes(#"Converted to table", {{"Column1", type date}}, "en-AU"),
#"Renamed columns" = Table.RenameColumns(#"Changed column type with locale", {{"Column1", "Date"}}),
#"Duplicated column" = Table.DuplicateColumn(#"Renamed columns", "Date", "Date - Copy"),
#"Extracted year" = Table.TransformColumns(#"Duplicated column", {{"Date - Copy", each Date.Year(_), type nullable number}}),
#"Renamed columns 1" = Table.RenameColumns(#"Extracted year", {{"Date - Copy", "Year"}}),
#"Duplicated column 1" = Table.DuplicateColumn(#"Renamed columns 1", "Date", "Date - Copy"),
#"Extracted month" = Table.TransformColumns(#"Duplicated column 1", {{"Date - Copy", each Date.Month(_), type nullable number}}),
#"Renamed columns 2" = Table.RenameColumns(#"Extracted month", {{"Date - Copy", "Month"}}),
#"Duplicated column 2" = Table.DuplicateColumn(#"Renamed columns 2", "Date", "Date - Copy"),
#"Extracted day" = Table.TransformColumns(#"Duplicated column 2", {{"Date - Copy", each Date.Day(_), type nullable number}}),
#"Renamed columns 3" = Table.RenameColumns(#"Extracted day", {{"Date - Copy", "Day"}}),
#"Duplicated column 3" = Table.DuplicateColumn(#"Renamed columns 3", "Date", "Date - Copy"),
#"Calculated start of month" = Table.TransformColumns(#"Duplicated column 3", {{"Date - Copy", each Date.StartOfMonth(_), type nullable date}}),
#"Renamed columns 4" = Table.RenameColumns(#"Calculated start of month", {{"Date - Copy", "StartOfMonth"}}),
#"Duplicated column 4" = Table.DuplicateColumn(#"Renamed columns 4", "Date", "Date - Copy"),
#"Calculated end of month" = Table.TransformColumns(#"Duplicated column 4", {{"Date - Copy", each Date.EndOfMonth(_), type nullable date}}),
#"Renamed columns 5" = Table.RenameColumns(#"Calculated end of month", {{"Date - Copy", "EndOfMonth"}}),
#"Duplicated column 5" = Table.DuplicateColumn(#"Renamed columns 5", "Date", "Date - Copy"),
#"Calculated start of week" = Table.TransformColumns(#"Duplicated column 5", {{"Date - Copy", each Date.StartOfWeek(_), type nullable date}}),
#"Renamed columns 6" = Table.RenameColumns(#"Calculated start of week", {{"Date - Copy", "StartOfWeek"}}),
#"Duplicated column 6" = Table.DuplicateColumn(#"Renamed columns 6", "Date", "Date - Copy"),
#"Renamed columns 7" = Table.RenameColumns(#"Duplicated column 6", {{"Date - Copy", "EndOfWeek"}})
in
#"Renamed columns 7"
1 Reply
- amitchandak
Super User
Fabrico , I remember either Lakehouse or Warehouse, but you were not able to do so. But despite that Time intelligence should work fine.
Microsoft Fabric: Create Date table Dataflow Gen2, use in Lakehouse, Warehouse| Time Intelligence