Forum Discussion

robofski's avatar
robofski
Resolver II
9 years ago

Date Formats

I'm in the UK

 

I have a field that I'm importing as YYYYMMDD. 

 

I'm writting reports that are mainly used in the US so I created a date field using:

 

DATEVALUE(mid(vw_PowerBI_Analysis[OrderCreateDate],5,2)&"/"&right(vw_PowerBI_Analysis[OrderCreateDate],2)&"/"&left(vw_PowerBI_Analysis[OrderCreateDate],4)

 

Which should have givien me mm/dd/yyyy

 

However in my model the the date is displaied as dd/mm/yyyy and when a US user views the published dashboard the dates continue to be dd/mm/yyyy.

 

Is there a way to have the date respect the user locale?

 

Thanks,

 

Dan

6 Replies

  • kcantor's avatar
    kcantor
    Community Champion

    robofski

    You can do this in the query editor. For each date column complete the following steps:

    Remove the existing Change Type step for the date.

    Right click the date column, select change type, select using locale (at the bottom)

    Change the data type to date

    Change the Locale to English (United States).

    You can also choose other formats from here as well. I would recommend duplicating the column and leaving both date types if the reports are used "at home" as well.

    In other words, have a US Date column and a UK date column for users to access.

    • robofski's avatar
      robofski
      Resolver II

      kcantorMany thanks.

       

      Looking at how that works it would appear it won't accept yyyymmdd as the input so I'll have to transform the column first to a dd/mm/yyyy or am I missing something?