Multi-language Label
Introduction
Multi-Language Label is a free custom visual for Microsoft Power BI. Custom visuals allow you to extend the capabilties of Power BI with additional visuals, not developed by Microsoft. This visual was developed by James Dales and is intended to provide the ability to display text using the built-in translation capability of Power BI.
Multi-Language Label is being submitted to AppSource and will be available directly within Power BI. In the meantime it is available from the downloads page of this site. If you find any bugs, please drop me an email at support@icon-map.com and I'll do my best to get them fixed ASAP.
Features
Modes of operation
There are two modes of operation for using the visual, one is to simply display the value of a measure, in the same way as the Card visual does in Power BI. This works with dates, numeric data or text.
The other use, is to display the name of the measure itself. In this example, rather than displaying the measure value 1, instead the name of the measure is shown.
The advantage of this is that, using Tabular Editor (version 2 - open source) (version 3 - commercial product), translations can be provided for measure names in multiple languages. The result is that the text in the appropriate language is shown automatically according to the language settings. As we're just changing the metadata of the measure name, we're not having to execute any DAX to return the right text, so it's a lightweight operation.
With this configuration in Tabular Editor,
when browsing with the Power BI settings or browser language set to French, the result is:
To enable this mode of operation, turn on the "Use Field Metadata" option in the Config section of the visual's formatting options.
Please note that Translations in Tabular Models require Power BI Premium, Premium Per User, Azure Analysis Services, or SQL Server Analysis Services 2017 onwards. For detailed information in creating multi-language reports in Power BI, I would suggest consulting the github repository created by Microsoft's Ted Pattison.
Embedded values
The visual allows you to embed one or more values within the text, that are substituted by measures values. In this example there are three placeholders identified by {1}, {2} and {3}. The placeholders relate to the fields dragged into the values section. The numbers relate to the order the fields have been added.
This is useful as in some languages, it may be necessary to show the values in a different order. For example in German:
With "Use Field Metadata" enabled, the placeholders should be placed in the Localized Label measure name (and translations). With "Use Field Metadata" turned off, the placeholders should be in the measure value.
Formatting Options
There are a number of formatting options available. The main text displayed by the visual can be displayed with a specific font, size and color and in bold, underlined or italics. The font color can be set using Expression Based Formatting. It's also possible to set the text formatting options for the values embedded into the tet using placeholders.
In addition to the main text and values, it's also possible to set specific terms in the text to have a different style. These terms are identified using # symbols (by default).
Layout options
Formatting options that apply to all the content include:
- Whether to wrap the text or not
- Horizontal alignment within the visual
- Vertical alignment within the visual
- Set the internal margins within the visual which allows the content to be offset