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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.