Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have date slicer which coming from date column contains date from 1-1-2017 to present date. currently date slicer shows min and max date but I want to set default date as last 7 days from present.
Constraints
Solved! Go to Solution.
Hi @Anonymous ,
Currently, there is no such function to set a default value for the slicer. But you can achieve this goal through the following methods.
1.Create a seperate table by entering data.
Here I use the exclamation mark to make him the first place in the slicer. The slicer is set to single selection.
2. Then the measure can be created like
Measure = IF(SELECTEDVALUE('Table (3)'[default value])="!previous 7 days",CALCULATE(SUM('Main table'[Value]),FILTER('Calendar',[Date]<=TODAY()&&[Date]>=TODAY()-6)),SUM('Main table'[Value]))
In this way, every time you open the report, the default is the data of the previous seven days. If you want to filter, select all from the single-choice slicer and filter the date range.
You can use the selection pane on the View| menu as needed, and then hide the slicer.
You can refer to the following links that may be helpful to you:
set the date with the latest record as default dat... - Microsoft Power BI Community
Default Date Filters using Calculation Groups - How to easily build in Power BI - YouTube
Default Current Month Slicer in Power BI - How to default to the current month - YouTube
Set Default Slicer Selection to Current Year or Month in Power BI - YouTube
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
There is a simpler solution I found to this problem while browsing through the custom visuals recently. It was a custom visual named Date Picker from Powerviz.
Without any Dax or extra effort, you can easily add all kinds of presets Like Max date, Max week, This week, Previous week, and all.
I think you can try it and add the previous week as a preset. Link to the Visual - https://shorturl.at/pAM18 ( I believe they do offer free version so check it out)
Hi @Anonymous ,
Currently, there is no such function to set a default value for the slicer. But you can achieve this goal through the following methods.
1.Create a seperate table by entering data.
Here I use the exclamation mark to make him the first place in the slicer. The slicer is set to single selection.
2. Then the measure can be created like
Measure = IF(SELECTEDVALUE('Table (3)'[default value])="!previous 7 days",CALCULATE(SUM('Main table'[Value]),FILTER('Calendar',[Date]<=TODAY()&&[Date]>=TODAY()-6)),SUM('Main table'[Value]))
In this way, every time you open the report, the default is the data of the previous seven days. If you want to filter, select all from the single-choice slicer and filter the date range.
You can use the selection pane on the View| menu as needed, and then hide the slicer.
You can refer to the following links that may be helpful to you:
set the date with the latest record as default dat... - Microsoft Power BI Community
Default Date Filters using Calculation Groups - How to easily build in Power BI - YouTube
Default Current Month Slicer in Power BI - How to default to the current month - YouTube
Set Default Slicer Selection to Current Year or Month in Power BI - YouTube
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |