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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
webportal
Impactful Individual
Impactful Individual

How to create a calendar table with second granularity?

I've built a calendar table using Power Query for the whole year of 2022 using second granularity.

 

Basically, by "cross joining" a calendar table with day granularity (365 rows) with a time table (24*60*60 rows).

 

The table contains 31.536.000 rows, all distinct values for column DateTime.

 

Now, after relating this table with a transacional table, the visuals do not show any values.

 

Here's a sample of the transactional table:

 

webportal_0-1644001819903.png

Although all these timestamps are present in the calendar table, I get an empty matrix when trying to visualize the results.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

In the Transaction table does the column you're creating the relationship on have timestamps as well?  If not then you won't get any matches because the Dates aren't lining up to the Timestamps.

Generally speaking in data modeling we keep our Dates and Times separate.  First, it cuts down on data volumes (only 86400 rows in the Time table and 365/366 rows per year in the Date table). 
I would try that - separate your Date and Time dimension tables and separate your Dates and Times in the transaction table.  Still gives you the capability to drill-down to the second level without super-sizing your model.

View solution in original post

4 REPLIES 4
webportal
Impactful Individual
Impactful Individual

@Anonymous 

I've managed to relate the DateTime table with the transactional table by converting the timestamp into integers (as the difference in seconds to the 1st datetime). This worked perfectly.

 

I also separated the simple Date and Time into two different tables with the great advantage - as you well refer - to decrease the size of the model.

 

Thanks for helping!

webportal
Impactful Individual
Impactful Individual

@Anonymous 

Yes, both tables have timestamps, that's why I don't understand why the relationship doesn't work.

 

Thanks for the tip, but what if you want to have continuous visuals? Eg: a line chart for a certain week where you may scroll horizontally to the second?

Anonymous
Not applicable

My guess is that the matching on the timestamps simply isn't lining up (although it should - datetimes are stored as numbers under-the-sheets so I'm surprised it's not working).  I'd try the "resolve-it-to-yyyymmddhhmmss-format-and-join-on-that" approach.

As far as creating visualizations (if you have separate date and time dimensions) you could simply stack your date fields on the axis shelf and then stack your time fields underneath them and the drill-down/expand-down should work with no issues.

Anonymous
Not applicable

In the Transaction table does the column you're creating the relationship on have timestamps as well?  If not then you won't get any matches because the Dates aren't lining up to the Timestamps.

Generally speaking in data modeling we keep our Dates and Times separate.  First, it cuts down on data volumes (only 86400 rows in the Time table and 365/366 rows per year in the Date table). 
I would try that - separate your Date and Time dimension tables and separate your Dates and Times in the transaction table.  Still gives you the capability to drill-down to the second level without super-sizing your model.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.