- Microsoft Power BI Cookbook
- Brett Powell
- 163字
- 2025-04-04 18:18:12
Date with locale
- If there's any potential for date data types to be sourced from a region with a different date standard than your local system, you should apply the Locale option to the Type Transform expression
- In the following example, the Original Date column stores date values in the format dd/mm/yyyy whereas the local system uses mm/dd/yyyy
- Trying to convert from Original Date to Date directly causes the error in Date Transform Only as the first two digits are greater than 12
- Specifying the source locale in the transform expression allows for successful conversion to the Date with Locale column in Figure 154:

Figure 154: Converting a Date from a Different Standard
- The Query Editor provides a simple interface for the source locale:
- Right-click on the column and select Using Locale from the Change Type dropdown

Figure 155: Change Type with Locale Interface
- Alternatively, you can add the locale to the expression itself directly

Figure 156: M syntax for Date Source Locale