Calculated PowerMetrics is a great feature and opens up so many quick and easy visualizations options. In this example I use sample sales data to produce a won/lost chart like this.
My data source shows both lost and won deals as positive numbers and my basic PowerMetric when segmented by Won/Lost shows the following chart.
However, I want the lost deals to show as negative values. I could build logic in my data source model to do this, but instead I decided it would be faster and easier to create a calculated PowerMetric. Using filtering and a small bit of math, I am able to get the result I want using this formula for my calculated PowerMetric:
This formula takes the sales filtered for wins only:
And adds it to the sales filtered for lost deals, multiplied by -1 to convert them to a negative number:
Finally, I set the view that I want by selecting
- chart type: bar,
- style: stacked bars
- -segment by: Won/Lost dimension
Just like that, I have the exactly the PowerMetric and view I need.