Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
Waleed18574
Frequent Visitor

How to Fix this Issue with a Customized Date Table

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

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

@Waleed18574 

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

1 REPLY 1
PhilipTreacy
Super User
Super User

@Waleed18574 

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.