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
rajulshah
Super User
Super User

Change date format to dd/MM/yyyy in SSAS

Hello,

 

I want my date columns in dd/MM/yyyy format in SSAS.

 

As I format the column using the following dax, it's data type is changed to "Text".

Date = FORMAT(Date[dates],"dd/MM/yyyy")

But, I am unable to filter and sort after doing the above transformation.

 

Please guide me further on how to have format as dd/MM/yyyy and also should be filtered and sort by date.

 

Thanks in advance.

15 REPLIES 15
mtauriza
New Member

 If you are using a live connection of SSAS, you must set a sorting column from your tabular model properties first. In VS you can find that option in this panel when the column is selected. That should work.

 

mtauriza_0-1696868685237.png

 

Nishantjain
Continued Contributor
Continued Contributor

@rajulshah 

 

What format is the date coming out currently? When you use the function "Format", it will given you the results in "text format" and not "date format" and will not be treated as "date". 

 

Is your date coming out as "mm/dd/yyyy"? if so, can you check if what the data type is?

Hello @Nishantjain ,

 

Yes, by default column datatype is date with format "MM/dd/yyyy". SSAS doesn't give any option to change the datatype to "dd/MM/yyyy". If I use the format function, it has datatype as text and if I change the datatype of this formatted column, the format changes back to "MM/dd/yyyy".

Anonymous
Not applicable

i'm trying to change date format to dd/mm/yy in SSAS using below expression and it works fine, but its considering it as text when i'm try chang the data type automatically its bringing back to mm/dd/yy 

=FORMAT(DATE(date),"DD/MM/YY")

 

if i keep in text format and use it in power BI desktop while sorting its going to be big problem, it wont sort as expected

 

anybody could help me on this please 

Hello @Anonymous ,

 

You can set the original date column in "Sort By Column" properties of the formatted column.

 

You can get to column settings by selecting the column and pressing F4.

 

Hope this helps.

@rajulshah 

 

I think you have got an issue with the locale of your settings. Check this article

 

Regional Settings

 

Power BI uses the regional settings to determine the format in which the dates are shown. If Power BI is recognising the data in "mm/dd/yyyy" format, it knows it is a date and then uses the regional settings to display in this format. 

 

Change your setting to see if that makes any difference


Thanks
Nishant

Hello @Nishantjain ,

 

We cannot change the regional settings in Power BI Desktop because it uses Live Connection. Please see below:RegionalSettings.JPG

Please guide further.

 

Thanks.

Got it. I don't think you can change the formatting in live connection See the link below 

 

Formatting SSAS values with a Live connection

 

You can also vote this idea

 

Better support for SSAS MD formatting

rajulshah
Super User
Super User

Hello,

 

I want my date columns in dd/MM/yyyy format in SSAS.

 

As I format the column using the following dax, it's data type is changed to "Text".

Date = FORMAT(Date[dates],"dd/MM/yyyy")


But, I am unable to filter and sort after doing the above transformation.

 

Please guide me further on how to have format as dd/MM/yyyy and also should be filtered and sort by date.

 

Thanks in advance.

Hi @rajulshah ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please feel free to ask.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-piga-msft ,

 

I have not yet found the solution to my problem yet.

Have you tried this approach provided by 

http://cloudbi.com.au/date-custom-format-in-ssas-tabular/ ?

 

I know the topic is of March 2019, but that solution helpded me to format date as needed not converting to text and also kepping the sort functionality on the date column.

tarunsingla
Solution Sage
Solution Sage

Try changing the Datatype of the newly calculated column to Date (from Modeling tab).

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @rajulshah ,

You could have a try if you sort the date column which is format as "dd/mm/yyyy" by the original date column, will it achieve your desired output.

Untitled.png

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-piga-msft ,

 

We are fetching data from SSAS, hence this option wouldn't help in solving my issue.

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.