Home and Learn: Power BI 2023
In the previous lesson, you set up a table and learned how to work with dates. In this leson, we'll continue with the same table as we tackle Date Slicers. We can do this on another dashboard in the same Power BI file. So no need to create a fresh Power BI dashboard for this lesson, just work with the one you have.
If you look at the bottom of Power BI, you'll see a single tab with the name Page 1:
You can rename this dashboard tab by right-clicking where it says Page 1. From the menu, select Rename Page.
Add a second tab by clicking the plus symbol, the one in the green square. A new blank dashboard will appear. However, note that the Data panel on the right is still showing the SalesData dataset. In other words, you won't have to reload any datasets, just because you have created a new dashboard tab.
Insert a table into this new dashboard. Just like before, click the Add data button to bring up the Data panel flyout. From the Data panel, select Widget_Color. Click the Add data button again and add the Units Sold column. Your table should then look like this:
Now add a Slicer visual to the dashboard: (Make sure your table is not selected.)
Once the slicer has been added, click the Add data button on the Build a Visual flyout. From the Data panel, select the Order_Date item:
Your slicer will then look like this:
So what have we got here? Well, we have a slider on the slicer. The round button on the left is for the minimum date you want to filter on; the round button on the right is for the maximum date you want to filter on. You can also choose a minimum and maximum date from the date pickers just above the slider:
Instead of the whole date, you can have just the date parts for your slicer.
From the Build a Visual flyout, click the right-pointing arrow next to Order_Date:
From the menu, select the date part you want from the Date Hierarchy. We've gone for Year:
And the slicer will look like this:
You can have more than one date part, though. Just select as many as you want from the list. The slicer will look like this, with all the years collapsed:
And like this, with items expanded.
Of course, you can also format the slicer. Click the paintbrush icon in the upper right corner of the slicer. From the Format options, expand the Slicer Settings item and Options:
The Options dropdown menu has only two items, Vertical list and Dropdown.
There are actually more options available. But we have all the date parts selected for the slicer, so you won't see any other options. If you go back to the slicer and delete all the date parts except Order_Date, the options will expand:
Format > Slicer Settings > Options
The options that will bring the slider back on the Slicer are Between, Before, After.
OK, we'll leave dates and slicers there. In the Next lesson below, you'll learn about something called Dax Measures.
<--Back to the Power BI Contents Page
Email us: enquiry at homeandlearn.co.uk