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
MarkNoordraven
Frequent Visitor

How to get a MMM-formatted X-axis with week-level data granularity, without aggregating to month?

Hi all,

 

I've got a table with 2 columns, values and weekly dates. Plotting it into a line chart and removing the date hierarchy results in the following chart:

Picture current state.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

What I'd like to do is change the X-axis format to "MMM" instead of the current "Mmm YYYY", while retaining the weekly tooltips as in current example and while retaining the weekly character of the line.

 

Things I tried:

  • Creating a custom date hierarchy of year-month-week-day.
  • Creating a separate date DAX-based calendar table with week numbers and dates formatted in "MMM".
  • Creating a separate Power Query based calendar table with week numbers and dates formatted in "MMM".

Challenges I run into:

  • These solutions result in a monthly line in which the monthly data points are an average of the underlying weekly data points.
  • The X-axis formatted as "MMM" is sorted alphabetically.
4 REPLIES 4
v-yuta-msft
Community Support
Community Support

Hi MarkNoordraven,

 

Click format-> X axis and change continuous to categorical type.

11.PNG 

 

Regards,

Jimmy Tao

Hi Jimmy,

 

Thank you for your response.

 

The proposed solution doesn't appear to work for me unfortunately, because of these reasons:

- The line turns into a monthly line in which each point on the chart is an average of the underlying weeks in the month.

- The months are sorted in an inappropriate order.

Picture current state2.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

rechterkant.JPGrechterkant categoricalk.JPG

 

 

When I try to change the order in the Modeling tab, I get the following error:

Can't sort by other column.JPG

 

 

Hi MarkNoordraven,

 

Change "Average of Value" to "Sum of Value" in the value field. 

11.PNG 

 

In addtion, the sort of date is decided by first alphanumeric when the value is text type, so you should change text type to date type.

 

Regards,

Jimmy Tao

Thank you Jimmy for looking into my question.

 

  • It appears formatting into date results in an error.

cant convert to date.JPG

 

  • Summing Value seems to result in the months in the axis shifting around, but not yet following chronological order.

axis months change.JPG

 

If it helps, please find below the .pbix file used in these examples: https://we.tl/t-VtukT8XB1x

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.