top of page

Visual Level Format String

  • mandarp0
  • Sep 18, 2024
  • 3 min read

Updated: 4 days ago

The "Visual Level Format Strings" feature in Power BI (currently in preview) allows you to apply format strings directly at the visual level. This feature enhances flexibility by enabling different formatting of the same measure depending on where it is used. The core ability that visual-level format strings provide is the ability to format visual calculations. Since visual calculations are not in the model, you could not format them, unless you were using them in data labels or in specific parts of the new card and new slicer visuals. With visual-level format strings, you can!  

ree

Visual level format strings, however, are useful even without using visual calculations. 

With the introduction of visual-level format strings, Power BI now has three levels for format strings: 


  • Model: A format string is applied to a column or measure, and it affects all visuals unless overridden. 

  • Visual: A new feature allows setting a format string directly on visuals, overriding the model's format string. 

  • Element: Format strings can be set for specific elements like data labels, which override both the visual and model-level format strings. 


These levels are hierarchical, with the model level being the lowest level and the element level the highest. A format string defined on a column, measure, or visual calculation on a higher level overrides what was defined on a lower level. Since visual calculations are not in the model, they cannot have a format string set on the model level but can be on the visual or element level. 

Let’s take an example using a measure. 

I have a Sales measure in my model, which is set to a decimal number format. To do this, you might have set the formatting for this measure using the ribbon: 


ree

 It returns a decimal number if you put this on a visual. 


ree

However, on a particular visual you want that measure to be formatted as a whole number. You can now do that by setting the format code on the visual level by opening the formatting pane for that visual and the Data format options found there under General: 

ree

Now that same measure shows as a whole number, but just on that visual:  

ree

You might want to use custom formatting for that measure but only in the data label on a particular visual. You set the format code on the data label for that measure.  

ree

So now the total shows in whole number, but only in the data label and not in other places (such as the tooltip as shown below). Notice how the element level format is used in the data label but the visual or model level format string is still used for the other elements in the same visual. 

For visual calculations, the same principle applies, but there's no model-level format string. For instance, if a visual calculation returns a percentage, you can now format it using the Data Format options under General in the visual's format pane. This allows you to customize the format directly on the visual. 

The introduction of visual-level format strings simplifies achieving precise formatting for visualizations. To use visual-level format strings, you need to enable the visual calculations preview. Here's how: 


  1. Go to Options and Settings > Options > Preview features. 

  2. Select Visual Calculations and click OK. 

  3. Restart Power BI Desktop to enable both visual calculations and visual-level format strings. 


Conclusion 

Visual-Level Format Strings, which significantly enhances customization options for report visuals. This feature allows users to apply unique number formats to each individual visual, independent of the underlying data model. It offers greater control over how data is presented, making it easier to tailor visuals to specific use cases, such as displaying currency in one chart and percentages in another, all sourced from the same data. This update marks a step forward in creating more dynamic and visually compelling reports.


For expert data solutions tailored to your business, contact us at Numlytics. Transform your data into actionable insights!  

 
 
 

Comments


bottom of page