Forum Discussion

BinaryBotany's avatar
BinaryBotany
Helper I
4 years ago

Continuous X axis using Date and Time dimension

A simple example of what I am trying to achieve written below and found in the linked PBIX:

https://ufile.io/y2gjrz2n

https://drive.google.com/file/d/1tZkHBrwxVQXXHG3CuH9JXL2-DQ7GjHOY/view?usp=sharing

 

I am trying to create a line chart with a dual Y axis, pulling measures from two different fact tables. Both fact tables contain the measure and a datetime. I want datetime to be on a continuous X axis. I am unable to join the two fact tables, as they have different dimensions linking to them not represented here. I can achieve what I want by creating a DateTime dimension to link the two tables, and the result looks like this:

 

 

However, I need to present data from multiple years, with the datatime being recorded at the second granularity. Thus, the DateTime dimension gets very large, unweildy and slow.

 

Best practice dictates that I use a date and a time dimension, and link these two fact tables to the two dimensions using an appropiate date and time column derived from the datetime in the fact. The relationships are laid out below:

 

 

I can achieve a continuous X axis when I use just use a date from Date Dimension on the X axis. However, I don't want to aggregate the data to the date level. Likewise, I can achieve a continue axis when I just use the Time Dimension (which isn't useful).

 

However, when I try and create a DateTime X axis using both the date from the Date Dim and the time from the Time Dim using a heirarchy, it creates a categorical X axis.

 

 

How can I achieve a continuous DateTime X axis using a Date and Time dimension? 

23 Replies