Forum Discussion
DAX Query Format Date
- 7 months ago
You can use the following DAX query to return only a formatted date, avoiding the ugly datetime string when copying to Excel:
EVALUATE
SELECTCOLUMNS(
Bookings,
"xDate", FORMAT(Bookings[Date], "MM/DD/YYYY")
)- This will output only the xDate column with dates formatted as MM/DD/YYYY.
- Excel will see the result as plain text, so the original datetime format like Wed, 01 Jan 2025 00:00:00 is avoided.
- You don’t need to reference the original Bookings[Date] column separately, which keeps your solution clean and avoids violating DRY principles.
If this answer helped, please click Kudos or Accept as Solution.Best regards,
Vaibhav Mahajan
- 7 months ago
Hi tecumseh,
AFAIK, although format function will convert your date column's datatype from date to text, it should work and give you dates in "MM/DD/YYYY" format when you are copying a cell from table or exporting the table.
I tried to double check and below is the result of export (same is the result on copying table values and pasting to excel/csv):
If you don't use the format function and try to change format of date column (with date datatype) from the column tools -> Format section, it will change for the PBI screen but not on exports. This is because excels take system's regional format and Power BI considers regional settings set for the pbix.
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!! Proud To Be a Super User !!! |