Home and Learn: Power BI 2023


Power BI Date Slicer

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:

The New Dashboard tab in Power BI.

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:

Power BI table showing to columns of data.

Now add a Slicer visual to the dashboard: (Make sure your table is not selected.)

Arrow pointing to the Slicer visual in Power BI 2023

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:

Adding an Order Date to the Power BI table visual.

Your slicer will then look like this:

A Power BI table with a Date slicer.

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:

Arrows pointing to two date pickers on a date slicer.

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:

Changing the date part of a Power BI slicer to year.

From the menu, select the date part you want from the Date Hierarchy. We've gone for Year:

The Data panel of Power BI 2023.

And the slicer will look like this:

A Power BI slicer for the Year.

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:

A collpased Power BI slicer showing the years

And like this, with items expanded.

An expanded Power BI slicer showing years, quarters, months, and days.

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 Slicer Settings option on the Power BI 2023 Format panel.

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:

Arrows showing which Power BI slicer date parts to delete.

 

Format > Slicer Settings > Options

Options for the Power BI 2023 slicer style.

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