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.
Hello,
I have a table that I want to export on csv with Dax Studio with a simple Date field formated as AAAA-MM-DD
When I open the csv file exported by Dax Studio , the dates fields are systematically modified on AAAA-MM-DD 00:00:00,000
Can anyone tell me how to fix this?
Thank you very much!
Raphaël
Solved! Go to Solution.
Dear @Raph ,
If you do not make any changes, the result of exporting .csv is shown in the figure below.
Based on your description, I suggest that you can use the FORMAT option in DAX query in DAX Studio to control the format of the output content.
Command:
EVALUATE
SELECTCOLUMNS('table',"Date",FORMAT([Date],"YYYY-MM-DD"))
Test result:
Obviously, although the date format adjusted in DAX studio is the expected "YYYY-MM-DD", the exported .csv file is still not in the format we want. This is because "YYYY-MM-DD" in the .csv file is date type by default, but the default format of "Date" is "MM-DD-YYYY".
Therefore, I suggest that you can enter a space before "Y" to convert the Date format into a Text format manually.
Command:
EVALUATE
SELECTCOLUMNS('table',"Date",FORMAT([Date]," YYYY-MM-DD"))
Test results:
I hope my suggestion can give you some help.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Yuna
Dear @Raph ,
If you do not make any changes, the result of exporting .csv is shown in the figure below.
Based on your description, I suggest that you can use the FORMAT option in DAX query in DAX Studio to control the format of the output content.
Command:
EVALUATE
SELECTCOLUMNS('table',"Date",FORMAT([Date],"YYYY-MM-DD"))
Test result:
Obviously, although the date format adjusted in DAX studio is the expected "YYYY-MM-DD", the exported .csv file is still not in the format we want. This is because "YYYY-MM-DD" in the .csv file is date type by default, but the default format of "Date" is "MM-DD-YYYY".
Therefore, I suggest that you can enter a space before "Y" to convert the Date format into a Text format manually.
Command:
EVALUATE
SELECTCOLUMNS('table',"Date",FORMAT([Date]," YYYY-MM-DD"))
Test results:
I hope my suggestion can give you some help.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Yuna
if you use the FORMAT option in the DAX query in DAX Studio, then you can control the output. Here is a simple query on a Date Table using FORMAT.
EVALUATE
SELECTCOLUMNS('Date', "Date", FORMAT([Date], "DD-MM-YYYY"), "DateKey", [DateKey])
###### Please Give Kudos if this answers your question ###############
Dear @danno
Thank you for your message. I think someting is missing in my understanding of your post.
What do you mean by "use the FORMAT option in the DAX query"?
If I run the query as showed in your exemple, it works on the pane "Results" but it doesn't change anything for the export.
So I guess I am missing something.
Thank you
Raphaël
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |