Adding contextual measures
A contextual measure lets you augment existing data, without having to add the values directly to the database. As an example, the following article adds personal goals to a chart presenting sales data by sales person.
2. Preparing the dashboard
From the Explore panel, drag LastName from the [Person].[Person] table of the Adventure Works database to the canvas of a dashboard.
From the [Sales].[SalesPerson] table, Drag SalesYTD to the Measures field of the Data Analysis Panel.
Re-visualize into a Bar chart with Horizontal bars.
3. Adding a contextual measure
On the Data Analysis Panel, under Measures, click click to add.
Select Contextual Measure.
A Measure Value toolbar appears. You can either provide a value, which will be used for every sales person, or click multiple to indicate individual values.
Type a value and click apply.
To change individual values, open the Data Analysis Panel and click the data input icon next to the measure.
On the Measure Value toolbar, click multiple.
The Data Preview panel opens.
Change the contextual measure values for some of the sales people. The value will be saved when you press enter or click elsewhere.
4. Adjusting the presentation
Right-click the contextual measure series and select Re-Visualize.
- When working with hierarchies, the values you provide are applied only to the current level. These values will not be distributed to lower hierarchy levels or aggregated into higher hierarchy levels. The highest-level values (for example Years) will be the only ones contributing to the Grand Total.
- Contextual measure data is not affected by the check in or check out state of the metric set. Undo Check Out does not change or remove data.
- You can change values while in View mode in the same way as making data annotations. If the metric set is checked out to you, the changes will be applied directly to the contextual measure; otherwise they will be treated as a data annotation.