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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
granthworth
Helper II
Helper II

Dates on X-Axis Showing "12AM"

Hey guys,

 

Small problem with hopefully a simple solution...

 

I setup a report and dashboard around a month and a half ago in which my x-axis labels are formatted like this:

 

Only Dates.png

 

I am now setting up a new report which is pulling from an Excel workbook with identical formatting as the prior report's source file. The Dataset in PBI is also formatted identically to the older PBI Desktop file. However, now my dates show ", 12AM" for some reason and I cannot seem to figure out how to elimnate the display of time info:

 

Times.png

 

I have changed the axis type to both Categorical and Continuous with no change in how the x-axis labels are displayed. Help.

5 REPLIES 5
greggyb
Resident Rockstar
Resident Rockstar

Select the field that you are using as the axis label. You should see a modelling ribbon menu appear. In this menu you can change data type and data format. You could change your data type to Date rather than DateTime, or you could just change your format to only display the date portion of the field's value.

 

Important note: Data Format ***DOES NOT CHANGE THE UNDERLYING DATA*** If you have a DateTime value with a non-0 time portion (aka not 00:00:00 time) and you change the format to only display the date portion, the time is not truncated, simply not displayed. You cannot use data format to alter what is stored in the data model, only to alter how that value is presented to the end user.

The following photos show the current data Type and Format settings as suggested:

 

Date.png

Format.png

 

I double checked the underlying data in the Excel workbook by expanding the "date" format to include "time" as well and the time portion is all zeros as mentioned:

 

1/26/16 0:00:00
1/26/16 0:00:00
1/26/16 0:00:00
1/26/16 0:00:00
1/26/16 0:00:00

I am so lost on this one....

 

 

If you've got your data type and format set as they are in that screenshot and you're still seeing times on the x-axis labels, that's a bug, right there. Make sure you submit a bug report.

 

A workaround, and something that we often use (for reasons similar to this, though I've not seen this bug before) in my company, is to add a [DisplayDate] field that is a string formatted to the exact display style you want in your reports. This lets all reporting have the exact same representation, regardless of locale settings or developers forgetting to set the format string. In Power Query you can use Date.ToText( [Date], <format string> ) to specify exactly what it should display as.

 

 

You can submit a bug report in PBI Desktop by using the 'Send a frown' option in the File menu.

The forums are a great avenue for discussing issues, sharing thoughts / ideas, and troubleshooting, but they are not the official medium to submit bug reports.

Proper bug reports will receive more attention from the devs than forum posts.

Thanks! I used the following DAX expression to reformat the data string as intended:

 

Date Labels = FORMAT('Line Calls'[Date],"mmm dd")

Which achieved what I was after:

 

Correct.png

 

I also submitted the bug report as I am still not sure why this visualization is displaying differently than the previous one I mentioned. Thanks again for the workaround suggestion!

Hi,

Even I had similar issue, when I filter by a specific condition, some results shows as like "13 Mar 12 AM" and some results shows just "13 Mar" on x-axis of "Clustered Column chart". 

I created a calculated column, DateSubmitted = format(Table[ColumnName], "MM/dd") and used this calculated column in the report, problem fixed.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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