March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I wanted to make a date lookup table (DateTable) to connect it with a transactions table (fTransactions). I used the function Calender to initiate the table with the command:
DateTable = CALENDAR(DATE(YEAR(MIN(fTransactions[Date])),1,1), DATE(YEAR(MAX(fTransactions[Date])),12,31))
This initiated the table with one column (Date) that included the dates.
Then I added the following columns:
Year = DateTable[Date].[Year]
MonthNo = DateTable[Date].[MonthNo]
Month = DateTable[Date].[Month]
QuarterNo = DateTable[Date].[QuarterNo]
Quarter = DateTable[Date].[Quarter]
Fiscal year = IF(DateTable[MonthNo]<4, DateTable[Year]-1,DateTable[Year])
Fiscal QuarterNo = IF(DateTable[QuarterNo]=1,4,DateTable[QuarterNo])
Fiscal Quarter = "Q"&DateTable[Fiscal QuarterNo]
Fiscal Period = DateTable[Fiscal Quarter]&"-"&DateTable[Fiscal year]
SortFiscalPeriod = DateTable[Fiscal year]*10+ DateTable[Fiscal QuarterNo]
I sorted the Month column by the MonthNo column and the Fiscal Period column by the SortFiscalPeriod column
Then, I marked it as a date table using the Date. Once I did, I received errors in every column except the first column (Date).
So...how to fix it?
Thanks
Solved! Go to Solution.
Try adding extra columns like this e.g
Year = YEAR(DateTable[Date])
MonthNo = MONTH(DateTable[Date])
Month = FORMAT(DateTable[Date], "mmm")
By using the .[Year] etc notation you are referencing the in built auto Date Time feature in PBI.
When you mark your new table as the Date Table, this auto Date Time is inaccessible so all your column definitions break.
Regards
Phil
Proud to be a Super User!
Try adding extra columns like this e.g
Year = YEAR(DateTable[Date])
MonthNo = MONTH(DateTable[Date])
Month = FORMAT(DateTable[Date], "mmm")
By using the .[Year] etc notation you are referencing the in built auto Date Time feature in PBI.
When you mark your new table as the Date Table, this auto Date Time is inaccessible so all your column definitions break.
Regards
Phil
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
119 | |
88 | |
74 | |
67 | |
49 |
User | Count |
---|---|
199 | |
141 | |
97 | |
79 | |
68 |