Forum Discussion
Date format issue in Power Bi Desktop in UK - some dates get converted to US format.
Here is the source data.
- Anonymous2 years ago
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.
2.Once you've selected Custom from the Format dropdown menu, choose from a list of firstformat.
3.Repeat the step1 and 2 and apply to another column
4.Final output
Best Regards,
Albert He
5 Replies
- MarkH
Helper I
I had tried that & unfortunately it doesn't work.
wierd 😫
- MarkH
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") )) - MarkH
Helper I
however, that creates the columns as text & when you convert them to datetime the original problem reappears 😪
- AnonymousNot 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.
2.Once you've selected Custom from the Format dropdown menu, choose from a list of firstformat.
3.Repeat the step1 and 2 and apply to another column
4.Final output
Best Regards,
Albert He