How to build a bar chart showing both values and percentage of total in Power BI

Created on 2020-04-27 06:12

Published on 2020-04-27 06:24

Objective

Suppose you want to create a bar chart that displays both the values as absolute numbers and as percentage of the total at the same time.

No alt text provided for this image

Power BI does not have a built-in visual that allows you to create something like that. Or does it? Well, follow the simple steps below to trick the “Line and Stacked Column Chart” into doing just that.

Steps

1 - Create a measure that calculates the ratio of the selected value and the total of the values in the column. For example:

Measure = sum('Table'[Volume])/CALCULATE(SUM('Table'[Volume]), ALL('Table'[Region]))

2-     Add the visual to the canvas and the measure as the line values. Optionally, you can also add the measure to the Tooltips.

No alt text provided for this image

3-     It's close, but we need to remove the secondary axis and the line from the chart. Go to the Y secondary axis properties and change the color of the axis labels to the same color of your background (white in the example).

4-     And, finally, go to the Shapes properties and change the line’s Stroke width to zero.

No alt text provided for this image

Done.