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
kqian
Regular Visitor

Display Whole Number as Date

I'm trying to get a date as the x axis for a scatter plot, which Power BI refuses to allow. As a workaround, converting the date to a whole number allows for plotting this along the x axis. However, the labels are now in whole number format instead of date (43466 vs 1/1/2019). Is there a way to hack the format string of a whole number to display the result as a date while keeping the underlying data type as a whole number?

2 ACCEPTED SOLUTIONS
edhans
Super User
Super User

I can put a date on the X axis. Put your date there, and data on the Y axis.

edhans_0-1609959646200.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

themistoklis
Community Champion
Community Champion

@kqian 

 

You can convert datevalue (43466) to date (e.g. 03/06/2019) using the following formulas:

DAX

Date = Format(Date[DateValue],"mm/dd/yyyy")

 

Power Query:

Date = CONVERT(Date[DateValue], DATETIME)

 

Make sure though that the field is numeric .. If it is text convert to numeric first (best to do in Query Editor - Power Query).

View solution in original post

2 REPLIES 2
themistoklis
Community Champion
Community Champion

@kqian 

 

You can convert datevalue (43466) to date (e.g. 03/06/2019) using the following formulas:

DAX

Date = Format(Date[DateValue],"mm/dd/yyyy")

 

Power Query:

Date = CONVERT(Date[DateValue], DATETIME)

 

Make sure though that the field is numeric .. If it is text convert to numeric first (best to do in Query Editor - Power Query).

edhans
Super User
Super User

I can put a date on the X axis. Put your date there, and data on the Y axis.

edhans_0-1609959646200.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.