Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MarkH
Helper I
Helper I

Date format issue in Power Bi Desktop in UK - some dates get converted to US format.

Here is the source data.

 

Just Source = DATATABLE (
    "StartDate", DATETIME,
    "EndDate", DATETIME,
    {
        { "16/03/2023 09:00", "16/03/2023 17:30" },
        { "16/03/2023 14:00", "16/03/2023 17:30" },
        { "17/03/2023 09:30", "17/03/2023 12:30" },
        { "16/03/2023 09:00", "17/03/2023 17:00" },
        { "16/03/2023 09:00", "20/03/2023 17:00" },
        { "16/03/2023 09:00", "20/03/2023 12:30" },
        { "16/03/2023 14:30", "20/03/2023 12:30" },
        { "17/03/2023 14:30", "20/03/2023 12:30" },
        { "16/03/2023 09:00", "27/03/2023 17:00" },
        { "02/03/2023 09:00", "27/03/2023 17:00" }
    }
)
 
Every thing is fine in the desktop  except the very last StartDate. 02/03/2023
This actually shows as 03/02/2023. All the other dates return UK format just fine.
Testing shows that if the first 2 digits are 01 to 12 it converts to US format.
I know you can change the locale in Power query but this is pure DAX.
To be clear, my locale is UK.
Why is it not consistent at keeping UK format?
How to fix it please.
 
Thanks
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MarkH ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Using DAX to create a calculate table:

 

Just Source = DATATABLE (
    "StartDate", DATETIME,
    "EndDate", DATETIME,
    {
        { "16/03/2023 09:00", "16/03/2023 17:30" },
        { "16/03/2023 14:00", "16/03/2023 17:30" },
        { "17/03/2023 09:30", "17/03/2023 12:30" },
        { "16/03/2023 09:00", "17/03/2023 17:00" },
        { "16/03/2023 09:00", "20/03/2023 17:00" },
        { "16/03/2023 09:00", "20/03/2023 12:30" },
        { "16/03/2023 14:30", "20/03/2023 12:30" },
        { "17/03/2023 14:30", "20/03/2023 12:30" },
        { "16/03/2023 09:00", "27/03/2023 17:00" },
        { "02/03/2023 09:00", "27/03/2023 17:00" }
    }
)

 

1.Select the field in the Modeling view, and then select the dropdown arrow under Format in the Properties pane.

vheqmsft_1-1703671024721.png

2.Once you've selected Custom from the Format dropdown menu, choose from a list of firstformat.

vheqmsft_0-1703671116860.png

3.Repeat the step1 and 2 and apply to another column

4.Final output

vheqmsft_1-1703671137443.png

Best Regards,

Albert He

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @MarkH ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Using DAX to create a calculate table:

 

Just Source = DATATABLE (
    "StartDate", DATETIME,
    "EndDate", DATETIME,
    {
        { "16/03/2023 09:00", "16/03/2023 17:30" },
        { "16/03/2023 14:00", "16/03/2023 17:30" },
        { "17/03/2023 09:30", "17/03/2023 12:30" },
        { "16/03/2023 09:00", "17/03/2023 17:00" },
        { "16/03/2023 09:00", "20/03/2023 17:00" },
        { "16/03/2023 09:00", "20/03/2023 12:30" },
        { "16/03/2023 14:30", "20/03/2023 12:30" },
        { "17/03/2023 14:30", "20/03/2023 12:30" },
        { "16/03/2023 09:00", "27/03/2023 17:00" },
        { "02/03/2023 09:00", "27/03/2023 17:00" }
    }
)

 

1.Select the field in the Modeling view, and then select the dropdown arrow under Format in the Properties pane.

vheqmsft_1-1703671024721.png

2.Once you've selected Custom from the Format dropdown menu, choose from a list of firstformat.

vheqmsft_0-1703671116860.png

3.Repeat the step1 and 2 and apply to another column

4.Final output

vheqmsft_1-1703671137443.png

Best Regards,

Albert He

MarkH
Helper I
Helper I

however, that creates the columns as text & when you convert them to datetime the original problem reappears 😪

MarkH
Helper I
Helper I

Fixed it by not using DATATABLE  and forcing a format. (You cannot format using DATATABLE)

 

Source2 = UNION (
    ROW ( "StartDate", FORMAT("16/03/2023 09:00", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("16/03/2023 17:30", "dd/mm/yyyy hh:mm") ),
    ROW ( "StartDate", FORMAT("16/03/2023 14:00", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("16/03/2023 17:30", "dd/mm/yyyy hh:mm") ),
    ROW ( "StartDate", FORMAT("17/03/2023 09:30", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("17/03/2023 12:30", "dd/mm/yyyy hh:mm") ),
    ROW ( "StartDate", FORMAT("16/03/2023 09:00", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("17/03/2023 17:00", "dd/mm/yyyy hh:mm") ),
    ROW ( "StartDate", FORMAT("16/03/2023 09:00", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("20/03/2023 17:00", "dd/mm/yyyy hh:mm") ),
    ROW ( "StartDate", FORMAT("16/03/2023 09:00", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("20/03/2023 12:30", "dd/mm/yyyy hh:mm") ),
    ROW ( "StartDate", FORMAT("16/03/2023 14:30", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("20/03/2023 12:30", "dd/mm/yyyy hh:mm") ),
    ROW ( "StartDate", FORMAT("17/03/2023 14:30", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("20/03/2023 12:30", "dd/mm/yyyy hh:mm") ),
    ROW ( "StartDate", FORMAT("16/03/2023 09:00", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("27/03/2023 17:00", "dd/mm/yyyy hh:mm") ),
    ROW ( "StartDate", FORMAT("02/03/2023 09:00", "dd/mm/yyyy hh:mm"), "EndDate", FORMAT("27/03/2023 17:00", "dd/mm/yyyy hh:mm") )
)
Dangar332
Super User
Super User

Hi, @MarkH 

use column tools 

in column tools choose format option and select    dd/mm/yyyy  or as you want 

 

Dangar332_0-1703074526285.png

 

I had tried that & unfortunately it doesn't work.

wierd 😫

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.