Skip to main content

Announcing semantic model APIs to update culture and collation

Headshot of article author Kay Unkroth

We’re introducing new semantic model API enhancements that allow model authors to programmatically update default culture and collation settings for deployed models. You no longer need to redeploy a semantic model in the Power BI service just to update its default culture, collation, or both. By enabling dynamic updates, the new culture and collation APIs facilitate smoother internationalization and localization workflows, reducing friction when adapting models for diverse audiences or regulatory standards.

In the context of a semantic model, culture refers to the set of language and regional settings that dictate how data is displayed and interpreted for end users. This includes conventions for formatting numbers, dates, times, currency, and even textual sorting rules, all of which can vary dramatically across different locales. In addition to a model’s default culture, you can add translations that align with user expectations in a particular country or region. By aligning a semantic model’s culture with its intended audience, you can deliver reports and analytics that feel native, familiar, and accessible to users around the world.

For more information about translations, refer to the Use locale values in multiple-language Power BI reports documentation.

Collation, on the other hand, defines a set of rules that determines how textual data—such as strings or words—is sorted and compared within a semantic model. It influences the order in which text entries appear, how case sensitivity is handled, and how characters from different languages are interpreted during comparisons. Collation is essential for ensuring that sorting and searching behaviors reflect cultural and linguistic conventions, such as whether uppercase letters precede lowercase ones or whether certain accented characters are treated as distinct or equivalent. By adjusting the collation of a semantic model, you can support table relationships with inconsistent casing and process data in a way that feels correct and native to users’ expectations, regardless of their language or locale. One typical scenario is to align the collation of a Direct Lake model with the collation of the underlying Fabric lakehouse or warehouse so that DAX queries and SQL queries use the same sorting and comparison rules.

By default, semantic models created in Power BI Desktop use the current culture of the operating system and are case-insensitive, but you can now leverage XMLA endpoints and the Tabular Object Model (TOM) through the latest Analysis Services client libraries to change culture and collation by using the UpdateCulture and UpdateCollation methods. You can also use the ResetCulture method to revert culture or collation to their original settings.

For details, refer to the Tabular Object Model (TOM) reference in the product documentation.

Note that you must re-supply the data source credentials for all data connections after altering the default culture or collation of a semantic model hosted on SQL Server Analysis Services or Azure Analysis Services. This step is not necessary in Power BI.

The following code snippet demonstrates how to set both the default culture and collation of a semantic model. The UpdateCulture method requires the culture argument. It must be a non-empty string. The collation argument is optional. If you only wish to fine-tune sorting and comparison rules without changing the culture, use the UpdateCollation method instead of UpdateCulture.

Database database = server.Databases.FindByName("UpdateCulture Demo");
if (database == null)
{
throw new ApplicationException(
"Database 'UpdateCulture Demo' cannot be found!");
}

// Update collation and culture with sample values
string newCulture = "en-US";
string newCollation = "Latin1_General_100_CI_AS";
database.Model.UpdateCollation(culture: newCulture, collation: newCollation);
database.Model.SaveChanges();

Of course, you can also update the culture and collation of a semantic model through the Tabular Model Scripting Language (TMSL) and the Tabular Model Definition Language (TMDL) by using the updateCulture command. The updateCulture command has optional culture and collation parameters that you can specify individually or together. Omitting a parameter leaves the setting at its current value. To reset a setting, specify an empty string instead. In TOM, you can use the aforementioned ResetCulture method to reset a setting. In TMSL and TMDL, this method is not needed because the updateCulture command can reset the settings.

We hope that the new culture and collation APIs make it easy for you to fine-tune your semantic models for your intended audiences and streamline your semantic model lifecycle management, deployment automation, and administrative scripts with greater ease and consistency than previously possible.

Refer to the Tabular Object Model (TOM) reference, the Tabular Model Scripting Language (TMSL) reference, and the Tabular Model Definition Language (TMDL) reference for more details.

We value the feedback of our community and are eager to hear your experiences with the new culture and collation APIs. Please connect with us on our forums, submit suggestions, or report issues through the official Power BI support channels. Your input will help us shape future enhancements and ensure our APIs meet the diverse needs of our BI pros, partners, and users.