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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
KWB
Frequent Visitor

Continuous x-axis issue

I have a problem when using dates in the X-Axis when the type is Continuous.

 

Our period data is stored as the last day of each month and when I put the period in the X-Axis, the axis doesn't line up with the data. This is the result:

 

Axis 1.png

 

The highlighted month should be February, as shown in the black popup, but the axis shows March.

 

When the type is changed to Categorical, it is now correct:

 

Axis 3.JPG

In case it's needed, the test data is:

 

Axis 2.JPG

 

I understand the dates need to be 'flexible' when chosing the continuous type in order for the dates to expand etc, but it can be misleading.

 

I know the other option could be to create another column to show the first day of the period instead of the last, but does anyone have any idea what is going wrong here? And what the best practice would be in this scenario? Ideally it would be better for Power BI to show the correct month without having to create another column.

 

Thanks

1 ACCEPTED SOLUTION
tjd
Impactful Individual
Impactful Individual

In order to properly show dates as "continuous" data, you need to be using dates from a date table, not your non-continuous fact table (that's categorical and why it is showing correctly as categorical).  After building the data table, you link your fact table dates to the date column in your date table.  The x-axis would then be from the date (or month, or year, etc.) column in the date table, not from your fact table.

View solution in original post

5 REPLIES 5
v-jiascu-msft
Employee
Employee

@KWB

 

Hi,

 

Could you tell me if your problem is solved? You can mark the right answer to help others if it's convenient for you.

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

@KWB

 

Hi,

 

@tjd is quite right. Your data in column “Period” is non-continuous. You can reference this post here: https://community.powerbi.com/t5/Desktop/what-do-the-continuous-and-categorical-type-options-on-the-...

You can also reference this example here. The column “No.” is continuous.

Continuous x-axis issue .jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tjd
Impactful Individual
Impactful Individual

In order to properly show dates as "continuous" data, you need to be using dates from a date table, not your non-continuous fact table (that's categorical and why it is showing correctly as categorical).  After building the data table, you link your fact table dates to the date column in your date table.  The x-axis would then be from the date (or month, or year, etc.) column in the date table, not from your fact table.

rlu
Frequent Visitor

Hi @tjd ,

 

How do I link my fact table dates to the date column? I'm having the same issue, but I created a custom Week column, which I'd like to use as my x-axis. Since it's a custom column, it is being stored as a Text data type rather than a Date data type. 

 

Here is the formula for my custom Week column:

weekInYear = year('calendar'[Date]) & " Week " & WEEKNUM('calendar'[Date])
 
I'd like to show weekInYear as my x-axis. How can I convert it to a continuous field so that it shows Week 10 after Week 9 instead of after Week 1? 
 
Thanks!
tjd
Impactful Individual
Impactful Individual

Your Fact-table date column should be set up as Date type.  Your custom week should be set up in your calendar.  You then link your Calendar-Date column to your Fact-table date column (in relationships).  When creating an x-axis, you should use the date values from your Calendar table, not your Fact-table.  It will then be continuous across all dates.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.