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 ,
some more details would be helpful. Here are a few options and questions:
1) Does the data look fine in Power BI? But as soon as you paste them into excel you get the horrible string (Wed, 01 Jan 2025 00:00:00). That would sound like a wrong cell format in Excel.
2) Where in Power BI are you evaluating the SUMMARIZECOLUMNS expression? What is the result for the first two columns? Could you provide an extract from the table?
3) What is your goal? Generating a table in Power BI to export it to Excel by Copy & Paste?