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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
kompalli
Helper I
Helper I

Slicer based default selection on another slicer

Hi All,

 

 I was trying to create a slicer based default selection on another slicer.

To tell it more clear I have country slicer and time aggregation slicer(MTD,YTD & MAT). If I select India ln country slicer by default MTD should be selected and I should be able to change another time aggregations as well.

Is there anyway to implement this.Any suggestions regarding this would be very helpful.

 

Thanks in advance 

1 ACCEPTED SOLUTION

Hi , @kompalli 

Thanks for your quick response. In my understand you can refer to this:
I create a table like this:

vyueyunzhmsft_0-1673495669343.png

This means when we select the "a", we can just select the "4,5,6" and for your need , it will be selected by the "4" by defalut.

(1)We need to create a table like this:

vyueyunzhmsft_1-1673495726520.png

(2)Then we create a measure:

Flag = 
 var _product = SELECTEDVALUE('Table'[Product])
 var _cur_month =FILTER(ALL('Table') , [Product] = _product)
var _min_month = MINX(_cur_month , [Month])
var _slicer =SELECTEDVALUE('Table'[Month])
return
IF( ISFILTERED('Table'[Product]) && _slicer = _min_month ,TRUE(),FALSE())

(3)Then we put the 'Table'[Product] in system slicer and put the other filed in the "Preselected slicer":

vyueyunzhmsft_2-1673495785186.png

(4)Then we can get the result is as follows:

vyueyunzhmsft_3-1673495805071.pngvyueyunzhmsft_4-1673495812175.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

4 REPLIES 4
v-yueyunzh-msft
Community Support
Community Support

Hi , @kompalli 

According to your description, you want to realize that when we select the first slicer then the second slicer show the the corresponding option.

First of all, for your needs, if we want to affect the choice of one slicer to affect the choice of another slicer, then we need these two fields to have a hierarchical relationship, and we can create a new table to define this hierarchical relationship.Then we can re-create the measure and the use the past measures to get the value we want .

 

Second, the default slicer in Power BI does not have the function of default selection, if you need to implement the default selection, you can try to use "Preselected slicer".

For more information, you can refer to :
Solved: How to set last 2 months as default filter in a po... - Microsoft Power BI Community

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hi @v-yueyunzh-msft ,

 

I have gone through the approach and checked preselected slicer as well. Still I couldn't achieve the exact required result.

  • As mentioned I am trying to implement slicer based default slicer selection.Screenshot 2023-01-11 145438.pngAbove is the example of two slicers one is product and other is Month Name.
  • If I select a particular product Amarlia then this selection should effect the change in other slicer based on what should be seen.  In this case Product is Amarlia and default should be April.
  • In the same way based on each product selection. I need some preselected selection of "month" that should be shown by default when product is being changed and at the same time I should be able to chnage to other month as well.

Please suggest some other alternative approaches if possible.


Thanks in advance.

Hi , @kompalli 

Thanks for your quick response. In my understand you can refer to this:
I create a table like this:

vyueyunzhmsft_0-1673495669343.png

This means when we select the "a", we can just select the "4,5,6" and for your need , it will be selected by the "4" by defalut.

(1)We need to create a table like this:

vyueyunzhmsft_1-1673495726520.png

(2)Then we create a measure:

Flag = 
 var _product = SELECTEDVALUE('Table'[Product])
 var _cur_month =FILTER(ALL('Table') , [Product] = _product)
var _min_month = MINX(_cur_month , [Month])
var _slicer =SELECTEDVALUE('Table'[Month])
return
IF( ISFILTERED('Table'[Product]) && _slicer = _min_month ,TRUE(),FALSE())

(3)Then we put the 'Table'[Product] in system slicer and put the other filed in the "Preselected slicer":

vyueyunzhmsft_2-1673495785186.png

(4)Then we can get the result is as follows:

vyueyunzhmsft_3-1673495805071.pngvyueyunzhmsft_4-1673495812175.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hi @v-yueyunzh-msft ,

Thankyou for the reply and suggestion I will work on it. It is really very helpful.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.