1. Sorting and more formatting
In this demo, we’ll see how to sort data in Power BI and look at some more formatting options. Let’s start by sorting the years in the slicer in descending instead of ascending order. We can do this by clicking on the three dots in the top right corner and changing the sort from descending to ascending.
We can do the same thing for the clustered bar chart. Click on the three dots, and go to Sort axis. Currently the data is sorted by amount, which is why November is first. Let’s change that to sort by MonthName. Uh oh, looks like September is the first month now. If we order in ascending order, April is first. It seems like the months are sorted in alphabetical order. This is not what we want. To sort the data in the correct way, from January to December, we need to modify the data.
To do this, we’ll go to the Data view. Here we’ll select the DimDate table. Now, what we want to do is modify a property of the data so it will always sort the way we want. The field that was used in the clustered bar chart, is MonthName. Let’s select that column. When doing that, the contextual menu at the top of the screen changes and there is an icon that says Sort By Column. In our case, we want to sort by the month number instead of in alphabetical order. We need to click on Sort By Column and then make sure to sort the MonthName column by MonthNumber. Let’s do the same for ShortMonth, so that if we choose either of these columns, the data is ordered in the correct way. Click on Sort By Column and sort by MonthNumber. Let’s go back to the report. As you can see, the visualization now orders the data the way we want it to, from January to December.
Now, let’s apply some additional formatting to our report to make it look nice. First, we are going to resize the tree map. Click on the paintbrush to navigate to the formatting pane, and under General, then Properties change the height to something smaller, let’s say 250. This way the tree map doesn’t overlap with the visual below. We could use this functionality to make visuals to be the exact same height or width. This will help make our report look better. Let’s also change the formatting on the slicer. Instead of showing a list of years, we want to display a dropdown menu. To do this, we go to the formatting pane and find the Slicer settings section under Visual. In the Options section, we can select the style of slicer we want, such as a dropdown. This limits the space the slicer takes up in our report.
As a final edit we are going to change the theme of the report. To do this we’ll navigate to View menu on top, and click on this little arrow in the themes pane. This will show us all the available options. Let’s choose the Innovate theme. That looks good right?
Alright, you now know how to sort data and edit your report. Time for exercises!
2. Let's practice!