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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
BlameXen
New Member

Variable Equals Selected Value in Slicer

I've been at this for a week now and it's driving me crazy 😅

 

I have a report that shows various different charts relating to information about cases. Only "Regular Feed" cases should be shown on the report, so I have a calculated column that marks all cases reported via "Method 1" and some from "Method 2" that regard certain topics as appropriate, and a page filter to filter to just those cases.

I now need to create a slicer with three options, "Method 1", "Method 2", and "Regular Feed", that changes the way that the data is filtered. If "Method 1" or "Method 2" are chosen, it shows just cases that came from those methods (which is explicited stated in the data). If "Regular Feed" is chosen, then it'll do the calculation that I talked about earlier.

I've tried making a switch statement and use a SELECTEDVALUE to produce a Variable that returns the selected value in the slicer however it keeps returning blanks. Any clue how to achieve this differently?

5 REPLIES 5
parry2k
Super User
Super User

@BlameXen not sure why you need selectedvalue , it is not required anymore, on relationship windows you will change the relationship:

 

parry2k_0-1701382141715.png

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@BlameXen create a new table for slicer (maybe you already have it) with two columns:

 

Slicer Display Name Method Name
Method 1 Method 1
Method 2 Method 2
Regular Feed Method 1
Regular Feed Method 2

 

Set the relationship on the "method name" with your data table, it will be many to many relationship, and change the relationship setting to "slicer table" will filter the "data table".

 

And that's it, use the display name column in the slicer and everything should work.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k Sadly no dice, the SELECTEDVALUE still returns blanks - though I'm unsure how to change a relationship setting to "Slicer Table" so it may be that? It's currently many-to-many

parry2k
Super User
Super User

@BlameXen SELECTEDVALUE function will only return value if a single value is selected otherwise it will return blank.

 

Now to answer your question, could you paste some sample data with the expected output? Make sure to paste your data in raw format as a table, not an image. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Ahh explains the difficulty. Below is an example of the raw data (anonymised):

CaseIDCaseTypeCaseMethodCaseDetails
1Type1Method1Anonymized
2Type3Method1Anonymized
3Type7Method1Anonymized
4Type1Method1Anonymized
5Type6Method1Anonymized
6Type3Method1Anonymized
7Type1Method1Anonymized
8Type1Method2Anonymized
9Type9Method1Anonymized
10Type3Method1Anonymized
11Type2Method1Anonymized
12Type5Method1Anonymized
13Type2Method1Anonymized
14Type5Method2Anonymized
15Type3Method2Anonymized
16Type1Method1Anonymized
17Type1Method1Anonymized
18Type4Method1Anonymized
19Type5Method1Anonymized
20Type7Method1Anonymized


When "Method1" is selected in the filter, I'd like it to look like:

CaseIDCaseTypeCaseMethodCaseDetails
1Type1Method1Anonymized
2Type3Method1Anonymized
3Type7Method1Anonymized
4Type1Method1Anonymized
5Type6Method1Anonymized
6Type3Method1Anonymized
7Type1Method1Anonymized
9Type9Method1Anonymized
10Type3Method1Anonymized
11Type2Method1Anonymized
12Type5Method1Anonymized
13Type2Method1Anonymized
16Type1Method1Anonymized
17Type1Method1Anonymized
18Type4Method1Anonymized
19Type5Method1Anonymized
20Type7Method1Anonymized


When "Method2" is selected:

CaseIDCaseTypeCaseMethodCaseDetails
8Type1Method2Anonymized
14Type5Method2Anonymized
15Type3Method2Anonymized


But then when "Regular Feed" is selected, only certain types with certain details are shown irregardless of Method (vague I know but it's a pretty sensitive sorting algrothim to our business):

CaseIDCaseTypeCaseMethodCaseDetails
3Type7Method1Anonymized
4Type1Method1Anonymized
5Type6Method1Anonymized
6Type3Method1Anonymized
7Type1Method1Anonymized
9Type9Method1Anonymized
10Type3Method1Anonymized
11Type2Method1Anonymized
12Type5Method1Anonymized
15Type3Method2Anonymized
16Type1Method1Anonymized
17Type1Method1Anonymized
18Type4Method1Anonymized
20Type7Method1Anonymized
15Type3Method2Anonymized
16Type1Method1Anonymized
17Type1Method1Anonymized
18Type4Method1Anonymized
19Type5Method1Anonymized
20Type7Method1Anonymized

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors