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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
arielcedola
Helper III
Helper III

How to set default value for slicer but enabling multiple slicer selection

Hi,

I'm using RANKX to set a default value to a filter in several visuals, as follows:

 

YearRank = RANKX(ALLSELECTED(Sales[Year]), CALCULATE(MIN(Sales[Year])),,DESC,Dense)

 

I set the current year (top ranked year in the ranking) as the default year in each visual by applying the Top N filter type as follows:

 

filter2.png

In this way I see only the records for the current year when I come to the report, which is the effect I was looking for. Therefore with the slicer I can easily see the records for the previous years, but if I want to see records for 2 or 3 years together, through a multiple selection in the slicer, obviously using this method it's not possible.

How could I set the by default visualization of the records for the current year, but having still the chance to select multiple years to visualize?

Here the link to the pbix file.

https://drive.google.com/file/d/1Z3JizbdKVR4XV98K0zdFopTCAWULumdH/view?usp=sharing

 

Thanks.

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @arielcedola ,

 

You can use ISFILTERED() function to check if the column is filtered. Then set default value if it returns false.

https://docs.microsoft.com/en-us/dax/isfiltered-function-dax

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

1 REPLY 1
v-jayw-msft
Community Support
Community Support

Hi @arielcedola ,

 

You can use ISFILTERED() function to check if the column is filtered. Then set default value if it returns false.

https://docs.microsoft.com/en-us/dax/isfiltered-function-dax

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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