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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
cheryl0316
Frequent Visitor

Change multiple slicer fields based on one slicer

NameFile Creation DateLast Visit DateOver2Years_File Creation DateOver2Years_Last Visit Date
Mary################YesNo
Tom################YesYes
Judy################NoNo
Amy################NoNo

 

 

I want to create a field switch.  Something like this

cheryl0316_0-1708638880764.png

 

If I click Last Visit Date, the date slicer will show Last Visit Date and the Over2Years slicer will show Over2Years_Last Visit Date.

Is it possible to change multiple slicer fields based on one field switch?

 

Any advice is appreciated. Thanks!

https://drive.google.com/file/d/13nALR8F99aM1G2boH24UnwuQTqDbOazg/view?usp=sharing

 

Btw how can I upload PowerBI file directly here?

 

 

 

 

 

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

Hi @cheryl0316 ,

Please try the following methods and check if they can solve your problem:

1.Create the two simple tables.

vjiewumsft_0-1709174330959.png

vjiewumsft_1-1709174343675.png

2.Create the new measure to filter.

 

Field Selected = IF ( SELECTEDVALUE ( 'FieldTable'[Field Switch] ) = "Last Visit Date", 1,0 )

 

3.Drag the measure into the date slicer and Over 2 years slicer. Select the show items is 1.

vjiewumsft_2-1709174370154.png

4.Select the Last Visit Date in the Field slicer. The result is shown below.

vjiewumsft_3-1709174379651.png

For the upload file question, only upload files directly if you are a super user or a support member.

Solved: How to upload PBI in Community - Microsoft Fabric Community

 

Best Regards,

Wisdom Wu

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

3 REPLIES 3
v-jiewu-msft
Community Support
Community Support

Hi @cheryl0316 ,

Please try the following methods and check if they can solve your problem:

1.Create the two simple tables.

vjiewumsft_0-1709174330959.png

vjiewumsft_1-1709174343675.png

2.Create the new measure to filter.

 

Field Selected = IF ( SELECTEDVALUE ( 'FieldTable'[Field Switch] ) = "Last Visit Date", 1,0 )

 

3.Drag the measure into the date slicer and Over 2 years slicer. Select the show items is 1.

vjiewumsft_2-1709174370154.png

4.Select the Last Visit Date in the Field slicer. The result is shown below.

vjiewumsft_3-1709174379651.png

For the upload file question, only upload files directly if you are a super user or a support member.

Solved: How to upload PBI in Community - Microsoft Fabric Community

 

Best Regards,

Wisdom Wu

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

 

 

 

 

 

 

 

 

Hi Wisdom,

 

Thanks for your reply. I have applied your method on my dashboard. Not sure if I did something wrong but the date slicer doesn't seem to work. Could you please have a look? Thank you.

 

https://drive.google.com/file/d/13nALR8F99aM1G2boH24UnwuQTqDbOazg/view?usp=sharing

lbendlin
Super User
Super User

You cannot set slicer values programmatically.  The slicer options you see are dictated by the data model and the current filter context.

 

This can lead to confusion when a previously selected choice is no longer part of the filter context.  This can lead to outright data leakage when RLS is involved. That's why you should never mix RLS with default slicer choices.

 

 

You can only upload files directly if you are a super user or a support member.

 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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