In this Power BI Tutorial, we will learn about the default value in Power BI Slicer. Also, we will discuss:
- Power BI Slicer default value
- Power BI Slicer default value current year
- Power BI Slicer default value current date and time
- Power BI Slicer default value current month
- Power BI Slicer default max value
Power BI Slicer default value
A default value will show the filtered data automatically on the Power BI Report page. We can set a default value on Power BI Slicer by following these steps:
Step-1:
Create a slicer on the Power BI Report page. Click on select the type of slicer (downward arrow). Then select Dropdown.
Step-2:
Then go to Format pane (paint roller icon) > Selection controls > turn on single select.
Step-3:
Now select an item from the dropdown of the slicer. It will appear as a default value on that visual like below:
This is how we can set a default date on the dropdown of Power BI Slicer.
Read Power bi slicer filter another slicer
Power BI Slicer default value current year
Now we will see how to set a current year as the default value in the Power BI slicer. To implement this, we have to follow these steps:
Step-1:
Go to Home tab > Transform Data.
Step-2:
Now it will redirect to the Power query editor page.
Go to add column tab > Custom column. A custom column page will appear, here we have to put the formula like this:
= Date.Year( DateTime.LocalNow() )
Step-3:
Now Click on OK. We can see a new column (Current year) in the data model having the current year (i.e. 2021) is being created. Then click on Close & Apply.
Step-4:
Move to the Report page. Create a slicer to take this new column(Current year) as a data field.
Step-5:
To make this value as default, go to Format pane > selection controls > turn on the single selection.
This is how to do the current year as the default value in Power BI Slicer.
Power BI Slicer default value Current Date & time
Now we will see how to set current date and time as the default value on Power BI Slicer.
For this, we have to follow these below steps:
Step-1:
On the report page, go to the Home tab > Transform Data
Then it will redirect to the Power query editor page, go to Add column > Custom column.
A custom column page will appear, here we have to put the formula like this:
DateTime.LocalNow()
After clicking on OK, we will show a new column(i.e. current date & time) that appears on the data model.
Step-2:
Click on Home tab > select Close & Apply. It will return to the Report page with updating data.
Here Create a slicer having the current date & time as a data field.
Step-3:
Now we will make it as default in Power BI Slicer. For this,
Go to Format pane > Selection Controls
On the above slicer, it is showing the current date and time as the default value.
This is how we can do Power BI Slicer default value Current Date time.
Power BI Slicer default value current month
Here we will see how to show a current month as a default value in Power BI Slicer.
For this, we have to follow these below steps:
Step-1:
On the report page, go to the Home tab > Transform Data
Then it will redirect to the Power query editor page, go to Add column > Custom column.
A custom column page will appear, here we have to put the formula like this:
Date.MonthName( DateTime.LocalNow() )
After clicking on OK, we will show a new column(i.e. current month) that appears on the data model.
Step-2:
Click on Home tab > select Close & Apply. It will return to the Report page with updating data.
Now, Create a slicer visual having the current month as a data field. To make it default value, go to format pane > Selection controls. Here, turn on the single selection toggle.
This is how we can set the current month as the default value in a Power BI Slicer.
Read Power bi treemap – How to use
Power BI Slicer default max value
In slicer, we can show the max value as default in 2 ways.
Way-1:
Step-1:
Create a slicer, having a numerical column like below:
Step-2:
From these values select the Max value(i.e. 12). Then save it or report page.
When we will open this particular Power BI report, we can see the max value of the slicer is by default selected.
This is a simple way to set a number as the default max number in a Power BI Slicer.
Way-2:
Here, we will take a Product’s profit column as a numerical column for this example. Tou can use any numerical column to implement the max value.
Step-1:
Create a calculated column on the data model, which shows the max value and put this below formula:
Max value = CALCULATE(MAX(financials[Profit]), ALL(financials))
Step-2:
Click on the Enter key. We can see a new calculated column(i.e Max Value) appears on the data model.
Now create a slicer visual and use this calculate column as a data field.
The above chart shows that the max value is being selected as a default on Power BI Slicer.
This is another way to set the max value as default on Power BI Slicer.
You may like the following Power bi tutorials:
- Power BI Slicer Search Box
- How to use Power bi ribbon chart
- Power BI Slicer Buttons
- Power BI Q&A – How to use with examples
- Power Bi Schedule Refresh
- Microsoft Power BI Stacked Column Chart
- Power Bi slicer multiple selections
- Microsoft Power BI Card
- Power bi slicer multiple columns with examples
- Power bi show value as percentage
Conclusion
From this above Power BI Slicer tutorial, we learned all about:
- How to set a default value in Power BI Slicer?
- How to set current year as default in Power BI Slicer?
- How to set current date and time as default value in Power BI Slicer?
- How to set current month as default in Power BI Slicer using formula?
- How to show the max value as default value in Power BI Slicer?
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
Soo, that’s all great. But what happens when the underlying data changes on next refresh, and the selected default value is no longer a valid option? It stills shows that as the default, with visuals making no sense.
great article, but is it also possible to set a default value were the user is also able to choose other dates
This still doesn’t answer my question. What good does a slicer do that is set to one value? I want to have a date slicer with YEARS of data, default to just today as the default max date, then x months ago as the default min date. I still can’t do this.