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

Select value from slicer in another table and use in filter

Hi,

 

I'd like to ask for help please.

 

I have a table table1 which contains "Sprint name" column and is used in slicer.

 

I have another table table2 which is summarized/filter from table1. I want to use the selectedvalue from slicer to be able to filter my table2 but with a different value:

filter(table2, table2[index] <= (select index from table2 where [table2]sprintname = selectedvalue(table1[sprintname]))

 

I'm not certain how to do the one in bold. When i create a var as part of table2 query:

var sprintName = selectedvalue(table1[sprintname]) <- this one doesnt seem to pick up any value

 

but when i create a measure under table2, i am able to get the selectedvalue but i'm not able to access it as filter in the table2 query (where measure was created). 

 

Thanks so much!

3 REPLIES 3
watkinnc
Super User
Super User

Have you tried just =, instead of <=? The SelectedValue is a text value, right?

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
Anonymous
Not applicable

Hi! Unfortnulately, no that doesn't work.

 

I wanted to filter may table2 based on the selected value from slicer in table1

 

If I hard code sprint name below it works:

Table2 =
VAR Result = SUMMARIZE(FILTER('Table1', some filters), 'Table1'[Sprint Name], 'Table1'[Iteration Start Date])
VAR FilteredResult = FILTER(Result, 'Table1'[Sprint Name] <= "Sprint 17")
Return FilteredResult

If i don't hard code, and get value from measure or selectedValue from table1, it doesn't work.
How can I get selectedvalue from slicer from table1?
 
Thanks so much!

Hi @Anonymous ,

Currently it is not supported to pass selected slicer values to a calculated table in Power BI, use selectedvalue() would return all blank value. 

If write like calculate(max('Table'[Name]),allselected('Table')), it would return the max name value from the table.

 

You have need to make hard code for the calculated table to filter it.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors
Top Kudoed Authors