Applying sorting – Enhancing Reports

Applying sorting

By default, Power BI will sort data alphanumerically. Fortunately, this is case insensitive, but it still could be a limiting factor for using Power BI. After all, April is not the first month of the year.

Figure 11.18 – This is not the order the months of the year should be in

We want our months to be sorted by month number, not by month name. In Power BI, we do this by choosing a different column to control the sorting. In the case of my Month column, I have a second column that is the year concatenated with the month number named MonthKey. I can choose this column as my sort column and it will force the Month column to sort numerically, not alphabetically.

Figure 11.19 – Selecting a column that is sorted in the order you want

Now our visualization is sorted by a column that doesn’t have to be displayed.

Figure 11.20 – Changing the sort column puts the months in the correct order

This is not just limited to date fields. If you have suborganizations that you always want to be sorted nonalphabetically, you can do the same thing to create a column to force the sorting the way you want it.

Figure 11.21 – Sort by is not just for dates. You can force other categorical values to sort in the order you need them to

This way, every time you create a visual sorted on this column, it will sort in the order you want.

It is important to know for the exam that you can choose to change the default sort order of a column by designating a sort by column. It is also noted that this does not just apply to date fields; you can use this for other types of columns too.

Sync slicers

You can control slicers and make a slicer on one page affect one or more other pages in the report. You do this by enabling the Sync slicers panel in the View ribbon.

Figure 11.22 – A landing page of slicers

One of the nice things you can do is to set the start page of the report to have all of your slicers. This allows users to filter the rest of the report. This behavior more closely mimics the setting of parameters some of your report consumers may have experienced with SQL Server Reporting Services or paginated reports.

One thing to be aware of is that you can choose whether to have the slicer show up on the report page. Not displaying the slicer on a report page will give you more canvas to work on, at the expense of possibly confusing your report consumers on how the page has been sliced.