Daily DAX : Day 370 INFO.OBJECTTRANSLATIONS

Power BI DAX Function: INFO.OBJECTTRANSLATIONS

What is INFO.OBJECTTRANSLATIONS?

This DAX function is part of the INFO category in Power BI, designed to retrieve metadata about your semantic model (like tables, columns, and translations). Specifically, INFO.OBJECTTRANSLATIONS returns a table listing all object translations defined in the current model. These translations allow you to localize names and descriptions of model objects (e.g., tables, columns, measures) into different languages, making reports accessible to multilingual users.

Syntax

INFO.OBJECTTRANSLATIONS ( 
    [ [, [] [,  [, [] [, … ] ] ] ] ] 
)
    
  • Return Type: Table
  • Parameters: Optional restriction pairs (name-value) to filter results, e.g., by object ID or language.
  • Limitations: Cannot be used in calculated tables or columns. Best for measures or queries in tools like DAX Studio.

The returned table matches the schema of the TMSCHEMA_OBJECT_TRANSLATIONS DMV, with columns like:

Column Name Description
ObjectID Unique ID of the translated object
LocaleName Language code (e.g., 'en-US', 'fr-FR')
CustomName Translated name for the object
CustomDescription Translated description (if any)

Use Cases

INFO.OBJECTTRANSLATIONS is useful for model introspection and multilingual support in Power BI reports. Here are simplified examples:

  1. Auditing Translations: Query the function to generate a report listing all translated objects and their languages, helping admins verify completeness.
    EVALUATE INFO.OBJECTTRANSLATIONS()
            
  2. Dynamic Language Detection: In a measure, filter translations based on user locale (e.g., via USERPRINCIPALNAME) to display localized labels dynamically.
    Translated Sales = 
    VAR CurrentLang = "fr-FR"  // Detect dynamically
    RETURN
    SUMX(
        FILTER(
            INFO.OBJECTTRANSLATIONS("LocaleName", CurrentLang),
            [ObjectType] = "Measure"
        ),
        [CustomName]
    )
            
  3. Model Documentation: Export translation metadata to Excel for documentation, ensuring global teams have consistent naming.


Comments

Popular posts from this blog

Daily DAX : Day 65 INFO.TABLEPERMISSIONS

Daily DAX : Day 55 PV