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
badger123
Resolver I
Resolver I

Format date axis

Please can someone help me with formatting date axis... I've had so much trouble with this. 

 

Basically I have this chart, which is currently using date hierarchy, month: 

Capture1.PNG

 

What I am trying to do is keep the chart as above but make the X axis formatted like: Jan 2018, Oct, 2018, Nov 2018 and so on... but when I remove the hierarchy and just do date, the chart looks like this:

Capture.PNG

 

Please help !!! 🙂 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Create two columns in the same table as your date like this:

 

date_display = FORMAT(dimCal[calDate],"mmm YYYY")
date_BOM = EOMONTH(dimCal[calDate],-1) + 1
 
Set date_display to sort by date_BOM, and use date_display on the x axis of your chart.
 
The FORMAT statement returns text, and PowerBI has no idea it represents a date, so it will just be sorted alphanumerically. You cannot sort that by the calDate column because there are multiple date values per date_display values. date_BOM ensures you have one date per date_display value which PowerBI will sort according to the calendar.
 
 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Create two columns in the same table as your date like this:

 

date_display = FORMAT(dimCal[calDate],"mmm YYYY")
date_BOM = EOMONTH(dimCal[calDate],-1) + 1
 
Set date_display to sort by date_BOM, and use date_display on the x axis of your chart.
 
The FORMAT statement returns text, and PowerBI has no idea it represents a date, so it will just be sorted alphanumerically. You cannot sort that by the calDate column because there are multiple date values per date_display values. date_BOM ensures you have one date per date_display value which PowerBI will sort according to the calendar.
 
 

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.