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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Rusciano
Frequent Visitor

Unable to change x-axis type from categorical to continous

Hello, everyone,

I would like to draw a line-graph to compare sales between different years. The data concern a seasonal product, which only has a market in September, October and November.


Since sales are not made every day, the graph is not a continuous line, but has jumps.

I would like to obtain a continuous line.


I have followed this guide https://community.powerbi.com/t5/Desktop/Unable-to-change-x-axis-type-from-categorical-to-continous-...


but the problem is that PowerBI does NOT let me switch the line type from "CATEGORICAL" to "CONTINUOUS".

 

Attached here is a copy of the file and video showing the problem.

 

Video of the problem 

https://1drv.ms/v/s!AhGat32AjfJJgeU9hGGLOvhU5h39tA?e=PcnUNQ 

 

File .pbix

https://1drv.ms/u/s!AhGat32AjfJJgeU-r_pU8DaV2CzEYA?e=2qkQWP 

6 REPLIES 6
Syndicate_Admin
Administrator
Administrator

Hello everyone
I solved this problem by duplicating the date field and applying a day-MonthName format

  1. Duplicate the date field using the DATE(year(),Month(),Day()) function
  2. In column tools you assign this new field
    1. Data Type = Date
    2. Format = March 14 (d "from" umm)
  3. Then you use this field in the graph and you worry that it uses directly in the data and not parts of its Hierarchy (because it is still a date)
  4. You select X-axis type of continuous axis

Best regards

JM

Thank you very much! This worked perfectly!

Applicable88
Impactful Individual
Impactful Individual

@Rusciano if i understand correctly, than you only need another "self made" table in Data input. In this table you simply create a rank for Jan to December and than you go to "Data" and you click on the monthname column and saying that this column should be "sort after" the numbers. Because number asc will put the monthname into right order. You can also do the same for Year Monthname. Alternatively you can do that in Powerquery. 

Hello, thanks for your kindly reply.

 

I am not sure to understand how to solve the problem. I created a new column named "month number", defining a range-order from 1 to 12. Then I replaced the x-axis category "date-month" with the new column "month number" and, finally, I sorted x-axis by the latter.

 

However I does not work, I cannot change x-axis from categorial to continous. 😭

 

Attached to my post there a very simple .pbix which figures out my problem. Could you help me downloading the file to check why i does not wok ?

 

Thanks a lot!!

Ciao @Rusciano, please check here:

 

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

 

You have limited data for that time frame, but now you can see the graph and in "categorical" format. 

Best. 

amitchandak
Super User
Super User

@Rusciano , when you start using date part, specially month name, it behave like text data and continous axis is not supported

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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