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
zacksg1
Advocate II
Advocate II

Eliminating summer months from x-axis of line graph

Hi!

 

I have school data that only has data values during the school year. I have a line graph set up to track several metrics continously over the course of several years. However, there is NO data during the summer months. How can I eliminate the summer months from the x-axis of a line graph visual? How can I get the x-axis to skip those summer months and jump right to September after May each year? 

 

As a sidenote, filtering the data for only school year data would not be helpful, since there isn't actually any data to start with for the summer. 

6 REPLIES 6
Greg_Deckler
Super User
Super User

Set your X-Axis to Categorical


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Ah, ok! 

 

When I switch to categorical, I get a better looking graph, but the category labels (dates) along the x-axis are listed for every single data point--how do I reduce it to one label per month along the x-axis? (When in continuous mode, this happened automatically.)

Hi @zacksg1,

 

Set X-axis type to Categorical.

Change date field to Hierarchy and remove day and quarter items.

Drill down to Year-Month level.

 

1.PNG

 

Best regards,

Yuliana Gu

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

This almost works, except that it aggregates the data by month and displays it as a single data point per month. I still need all of the weekly data points to actually display on the graph, to be able to see the changes week to week, but the labels just don't all fit. 

Hi @zacksg1,

 

If you have a WeekNum field in data table, you could add it to "Legend" section of the chart, to show weekly data per month.

 

Regards,

Yuliana Gu

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

Well, if you have something like a date that looks like 1/12/2018, then create a Month column with a formula like:

 

Month = MONTH([Date])

You can also do something like FORMAT([Month],"mmmm") and things like that to get the format that you want. Often, in these cases, you will have a Month column like "January", "February", etc. and a "MonthSort" column like 1, 2, 3, etc. and you will set your sort by column for your first column to be your second column so that everything is in the right order.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.