Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

"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?? Robot Mad

 

Also, keep voting!

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community 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

View solution in original post

10 REPLIES 10
ahmadov_10
Helper II
Helper II

Hello : i want to see my slicer by default filtered when i open my report in the default value (auto filtering) 

ahmadov_10_0-1668528087116.png

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) 

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 ??

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).

https://community.fabric.microsoft.com/t5/Desktop/How-can-we-set-Slicer-to-set-specific-value-as-def...

Or may be can we use a measure with selectedvalue as a work around for this issue ?? Your thoughts ??

you want to say : a measure that takes a formula : selectedvalue(slicerValue , "defaultValue") and you use it in the filter section of Slicer to filter the slicer by a default value.
--> didn't work , i tried it : the measure use a DAX function selectedvalue and i think this function is based of the slicer behavior.
you can try a bookmark or search again for another solution.

Rickmaurinus
Helper V
Helper 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.

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) 

ahmadov_10_0-1668528087116.png

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) 

Anonymous
Not 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

v-yuta-msft
Community Support
Community 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

v-yuta-msft
Community Support
Community 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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.