Forum Discussion
"Current year" as default value for year slicer hack?
I know this is not supported yet™ but I'd like to ask if someone knows any workaround...
I've thought about a couple of things:
- Having every value displayed in the report as a measure like this: IF ( ISFILTERED ( yearColumn ), measure, CALCULATE (measure, FILTER (current year))) So, by default, every measure would be filtered by the current year except if you select the year filter. This is time consuming (especially if you have to modify tens of reports), unintuitive for the end user and not always possible.
- Two slicers, one (selected) with only one option (the current year) and another one with all the years. Also not very intuitive nor pretty.
The required functionality is: always load the report filtered by the current year and still have a easy way to change between years (like, with a simple slicer).
Any ideas?? :robotmad:
Also, keep voting!
Hi ThunderRoad,
You may need to create an addtional calculate column to achieve current year and then use that column to filter the chart, similar case for your reference: https://community.powerbi.com/t5/Service/Default-value-in-Report-Filter-Panel/td-p/47574.
Regards,
Jimmy Tao
10 Replies
- v-yuta-msftCommunity Support
Hi ThunderRoad,
You may need to create an addtional calculate column to achieve current year and then use that column to filter the chart, similar case for your reference: https://community.powerbi.com/t5/Service/Default-value-in-Report-Filter-Panel/td-p/47574.
Regards,
Jimmy Tao
- AnonymousNot applicable
Hello,
You can select the current year in the slicer and save,publish the report, which acts as default value.
The user will have the ability to filter other years if they want to.
If you have any other calculations to be performed based on the selection. You can use the "SELECTEDVALUE" function in the measure which brings the Current year(in dafulat case)/the user selected value in all other cases.
Hope this helps.
Let me know if you have any questions.
Thanks,
Soumya
- RickmaurinusHelper V
You could also go the way of performing the logic in Power Query. You would then check whether a year equal the Date.Year( Date.From( DateTime.LocalNow() ) ), and if so replace the year by the text: "Default".
This ofcourse turns the column to a text type. So it would be good to have a regular 'year' column and a 'year default' column.You can see more on this here: https://gorilla.bi/power-bi/set-default-slicer-value/
--------------------------------------------------
@ me in replies or I'll lose your thread
Master Power Query M? -> https://powerquery.how
Read in-depth articles? -> BI Gorilla
Youtube Channel: BI Gorilla
If this post helps, then please consider accepting it as the solution to help other members find it more quickly.
- ahmadov_10Helper II
Hello , i follow your solution but it doesn't satisfy my need : i want to see my slicer by default filtered when i open my report in the default value (auto filtering)
I tried isfiltered function but didn't work . (it seems like when your customer demand to show by defaut sales data in last year and after he have the choice to change slicer value)
- v-yuta-msftCommunity Support
Hi ThunderRoad,
Have you solved your issue by now? If you have, could you kindly mark my answer to close the thread?
Regards,
Jimmy Tao
- ahmadov_10Helper II
Hello : i want to see my slicer by default filtered when i open my report in the default value (auto filtering)
I tried isfiltered function but didn't work . (it seems like when your customer demand to show by defaut sales data in last year and after he have the choice to change slicer value)
- AnonymousNot applicable
Hi, Is this solved ?? I have a similar requirement where i have to show a default year in filter and then give the end user power to filter all the other years too. Could you help ??
- ahmadov_10Helper II
Until now (May 2023)
there is not an option to configure directly to set a default value on the Power BI Slicer. But as an alternative solution, we can define a bookmark default year 2015 for example and use it with a reset button. After , oblige the client to use the slicer initially to display the visuals (use bookmarks to put blank frames to hide the visuals and will not be displayed except when using Slicer).