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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
EVEAdmin
Helper V
Helper V

Calendar table issues

Hi all,

 

my sales table is like in this image
Snag_61000dd.png

 

I created a date table using this code:

Calendar = CALENDAR(FIRSTDATE(Invoices[InvoiceDate]), LASTDATE(Invoices[InvoiceDate]))

but it returned the following error

A date column containing duplicate dates was specified in the call to function 'FIRSTDATE'. This is not supported.

I suspect the error occured because there are duplicates like 01/02/2010 00:00:00, for all those record with no time stamp.
So, I used this code instead to create the calendar table:

Calendar = CALENDAR(MINX(Invoices,Invoices[InvoiceDate]),MAXX(Invoices,Invoices[InvoiceDate]))

That created the table, as follows:

Snag_617f57c.png

 

All timestamps are set to 00:00:00
I then established the relationship from the Invoices table to the Calendar table, with Many (invoices) to One date and Single Cross Filter.

However, reports are inconsistent. For example, there are not data for 2017, 2018 and 2019.
I suspect this issue is caused by the time stamp. Those sales records where the date includes the time stamp will not find any corresponding value in the Calendar table, because 05/05/2019 11:37:43 is different from 05/05/2019 00:00:00
If that is the issue, what would be the solution? Create a new column in the sales table, with the date but without time stamp and then generate the Calendar based on values in this new column?

Hope I am clear, tnx.

1 ACCEPTED SOLUTION
EVEAdmin
Helper V
Helper V

That was the issue, indeed.

The calendar table records were all like         05/05/2019 00:00:00

Whereas the sales table records were            05/05/2019 14:30:59

And therefore, the sales table would not find any corresponding date in the calendar table.

I added a calculated column to the sales table, as described in this solution, and it all started working.

View solution in original post

1 REPLY 1
EVEAdmin
Helper V
Helper V

That was the issue, indeed.

The calendar table records were all like         05/05/2019 00:00:00

Whereas the sales table records were            05/05/2019 14:30:59

And therefore, the sales table would not find any corresponding date in the calendar table.

I added a calculated column to the sales table, as described in this solution, and it all started working.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.