Culture codes Archive | THE SELF-SERVICE-BI BLOG Wir lieben Microsoft Power BI Thu, 10 Apr 2025 11:45:00 +0000 de hourly 1 https://wordpress.org/?v=6.8 https://ssbi-blog.de/wp-content/uploads/2019/10/Favicon-150x150.png Culture codes Archive | THE SELF-SERVICE-BI BLOG 32 32 Culture codes in M functions https://ssbi-blog.de/blog/technical-topics-english/culture-codes-in-m-functions/ https://ssbi-blog.de/blog/technical-topics-english/culture-codes-in-m-functions/#comments Mon, 15 Oct 2018 13:49:11 +0000 https://ssbi-blog.de/?p=4563 At the time of writing (October ’18) there are 35 functions in M that accept a parameter called culture. The functionality of this parameter is relatively easy to understand. Let’s use the function Date.DayOfWeekName(#date(2018,1,1), "zh-HK") as an example. If you run this function on your computer, you will get the day name of January 1, 2018 […]

Der Beitrag Culture codes in M functions erschien zuerst auf THE SELF-SERVICE-BI BLOG.

]]>
At the time of writing (October ’18) there are 35 functions in M that accept a parameter called culture. The functionality of this parameter is relatively easy to understand. Let’s use the function Date.DayOfWeekName(#date(2018,1,1), "zh-HK") as an example. If you run this function on your computer, you will get the day name of January 1, 2018 (which is Monday) in Chinese language (which is  星期一), regardless of the culture set on your operating system. Because this parameter is mostly optional (except for function Comparer.FromCulture()) you can leave it away. In this case, the culture that is set on your operating system is automatically used.

Update (10th of November 2018): As you can read in the comment from Curt Hagenlocher below, who works for the Power Query team in Redmond, I wasn’t very precise with my last remark. If you want to learn about ‚document culture‘, read his comment in the comments below. Thank you Curt, for your correcting 🙂

If you want to use Power Query to determine which culture is set on your PC, you can use the following function: Culture.Current.

The reason why I am writing this article is not that the way culture works is so difficult to understand, but that

  1. the official documentation does provide a list of all available culture codes, but it is very hard to find
  2. for some functions in the official documentation of the specific function, the parameter culture is not even listed

Here comes a list of functions, which can handle the parameter culture. For the red ones the parameter culture is not mentioned in the official documentation:

  • Byte.From
  • Comparer.FromCulture
  • Currency.From
  • Date.DayOfWeekName
  • Date.From
  • Date.FromText
  • Date.MonthName
  • Date.ToText
  • DateTime.From
  • DateTime.FromText
  • DateTime.ToText
  • DateTimeZone.From
  • DateTimeZone.FromText
  • DateTimeZone.ToText
  • Decimal.From
  • Double.From
  • Int16.From
  • Int32.From
  • Int64.From
  • Int8.From
  • Number.From
  • Number.FromText
  • Number.ToText
  • Percentage.From
  • Single.From
  • Table.TransformColumnTypes
  • Text.Format
  • Text.From
  • Text.Lower 
  • Text.Proper
  • Text.Upper
  • Time.From
  • Time.FromText
  • Time.ToText
  • Value.FromText

Thanks to Jes (see the first comment below) I now know, why it makes sense, to have the culture parameter inside the functions  Text.Lower, Text.Proper and Text.Upper functions.

You can find a list of officially supported culture codes here. You have to scroll a bit down to the end. My thanks go to Sergei Baklan, who helped me to find this list 🙂

Regards from Germany,

Lars

Der Beitrag Culture codes in M functions erschien zuerst auf THE SELF-SERVICE-BI BLOG.

]]>
https://ssbi-blog.de/blog/technical-topics-english/culture-codes-in-m-functions/feed/ 8