__STYLES__
In 2012, he took a deep breath and without hesitation, chipped the ball in the penalty shootout. Andrea Pirlo executed the panenka perfectly to leave England's Joe Hart stranded in goal. Panenka is a penalty kick technique where the player chips the ball down the center of the goal. It's a beautiful technique and very useful in the right moment.
Therefore, I name this content: Panenka! Through this content, I'd like to share techniques that I applied in Power BI, SQL, or Python.
In this session, I wanna talk about the great technique in Power BI that founded by Bas Dohmen: Overcoming Label Cutting in Bar Chart (For the further steps, you can check on his Youtube channel, How to Power BI: https://www.youtube.com/watch?v=EiIAkJ9R7mM&t=799s). I will use my latest project to show how useful it is.
When we create a bar chart, sometimes we often face long axis label issue like this: To make it looks simply, all we need to do is creating several measures and do a little bit formatting.
First, we need to create a measure named "Label Placeholder". Why do we need to create this measure? It will act as a place for our bar chart labels later. We store the value of 0 for the Label Placeholder. Using Clustered Bar Chart, the Label Placeholders will be look like this: As you can see in the Bar Chart, each Customer Name have 2 values, Label Placeholder and Total Profit. The data label of "Label Placeholder" is 0. Later on, we will replace the label using our custom label.
Next step, we will create a measure of Custom Label for Bar Chart. Since we will display list of most profitable customers, we use [Customer Name] from Customers table. If you want to show list of products, you can use [Product Name] from your Products table.
After we create a measure for custom label, we can apply that measure into Label Placeholder series. In the formatting tab, we need to turn on Data Labels >> In Series menu, choose Label Placeholder >> Turn on Custom Label >> Drag and drop "Label Bar Chart - Customer" into Field menu.
Applying this technique is very useful if you want to deliver solid information in bar chart without worrying about long axis label issue. Happy analyzing!