Zebra BI Tables visual offers an option to change the standard abbreviated measure names to your own names. The feature can be used in different variations, allowing more flexible and responsive reports that can adjust to different contexts without requiring manual updates or multiple versions of the same report. Instead of creating multiple reports for different scenarios, dynamic headers allow you to create a single report that adapts to various situations. This reduces maintenance and ensures consistency across reports.
How to enable dynamic column headers
Access to this feature is available on individual column levels, meaning you can change the logic on the desired number of columns.
- Hover over the header of a particular column where access to a menu will appear.
- By clicking on the dropdown button, you will notice an icon on the right side of the window allowing you to “Use measure name” instead of the abbreviation.
- Selecting this option will display the measure name. To turn it off, simply click the icon again.
Example with field parameters
Below is a demonstration of the practical use of the feature when a report is being utilized in different countries or regions, and the headers need to correspond to the language selection at the top.
First, create a fields parameter for each measure needing a translation, and add a translation directly in the DAX. To create a field parameter, navigate to the top taskbar, click on Modeling – New Parameter – Fields, and add the first measure you want to work with. Insert only one measure because additional parameters can be added later on. Name the parameter accordingly.
Repeat this step for each measure you want to apply translated header names to. In this example, four field parameters will be crafted and can be found in the data model.
Next, create a simple table of languages that will link to the parameters created and later serve as a slicer for language selection. Again, navigate to the taskbar and click on Home – Enter data, and in the new window, add the abbreviations for languages. Name the table Languages and hit Load to add it to the data model.
Get back to the created parameters. Take the _AC language change parameter created for the AC measure. The DAX for the parameter includes only one row for the measure added upon creation.
Populate the parameter with additional rows and determine languages. The original row can be copied several times; change the name and the sort order for each row of the parameter. At the end of each row, add the fourth attribute, the abbreviations used for the Languages table.
You can copy the DAX below.
_AC language change = {
("Actual", NAMEOF('Sales'[AC]), 0, "En"),
("Aktuell", NAMEOF('Sales'[AC]), 1, "De"),
("Actuel", NAMEOF('Sales'[AC]), 2, "Fr")
}
Then, create a relationship between the Language table and the _AC language change fields parameter as follows: Create a relationship with One-to-many cardinality and a Single cross-filter direction toward the fields parameter.
After all fields parameters are created and the relationships established, the Model view looks as below:
Then, return to the Report view and fill the canvas with the necessary visuals. Place a slicer at the top and insert the Language field, allowing us to switch between options easily.
Add a Zebra BI Tables visual and fill in the desired dimensions, and then you can add the field parameters for each value. We’ve also added one custom-calculated column, which calculates the % of Total. Turn on the Dynamic column headers on each column.
Verify if the selections made in the slicer reflect on the column header names.
You can improve the report page by incorporating comments directly onto the visual using the annotation layer.
Fields parameters offer various options to achieve dynamic headers, for example, when you want to switch between several versions of Plans or Forecasts. You can easily create a fields parameter from several measures and immediately get the switch option where the headers reflect the selection of a version. You can check the example on this link.
Example with Tabular editor
Another effective way to apply dynamic column header names based on region is through translations created in the Tabular Editor. This option will allow the headers to reflect the end user’s browser language when they open the report in Power BI Service or App.
Note: Power BI Desktop does not display model translations; they will only become visible once the report is published.
To open the Tabular editor, go to the External tools tab and click on the Tabular Editor icon.
When the program opens, first navigate to the Translations folder and expand it. Adding additional translations to your data model allows you to create alternative language versions for metadata elements within your data model. This includes the names, descriptions, and display folders of various objects. Check which languages are already included.
Right-click on the folder, select New Translation and select Cultures from the list provided.
New languages will be added to the Translations folder, as shown above.
Next, expand the Tables folder in the Model.
Navigate to the table which contains measures and select the first measure. Scroll down to the bottom of Properties and expand the Translation, Perspectives, Security section. Expand the Translated Names where all translations/languages added beforehand will appear. Type a name for each translation/language. Repeat this step for all measures needing translations.
Make sure to Save all changes made in the data model before closing the Tabular editor.
When you return to the Power BI Desktop file the changes won’t be visible regardless of the language selection in the application. To see changes, the file must be published to the Power BI Service. To test if the headers are matching the browsers language, change the language within Power BI Service under Settings – General – Language.
Conclusion
To summarize, dynamic column headers in Zebra BI Tables are important for creating adaptable reports, such as multilingual ones. This feature not only improves the user experience by tailoring content to specific needs but also simplifies report management and maintenance, making it a valuable asset for delivering responsive and localized insights.