Forum Discussion
Filtering a Table by the Selected Items in Another Table
I have a table called Table_A. One of the columns is called Region.
I have a second table called Table_B. Table_B is associated with a List Slicer. So some of the rows in Table_B can be selected using the slicer. The values in Table_B are unique. The Region column in Table_A contains values that are in Table_B.
What I would like to do is create a dynamic table using SELECTCOLUMNS with a FILTER statement that basically says select all the rows from Table_A where the Region column is one of the values selected in the slicer associated with Table_B.
I have looked at various parts of DAX but none of them seem to obey the filtering created by the slicer.
Any suggestions?
5 Replies
- parry2k
Super User
Anonymous I think it will be easier if you provide sample data with the expected output, it will help to provide a solution. Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 - AnonymousNot applicable
Does the following meet the requirements?
NewTable =
VAR SelectedTableB = VALUES( Table_B[Slicer_column] )
Return
SELECTCOLUMNS(FILTER( Table_A, [Region] IN SelectedTableB ),
...
)
- AnonymousNot applicable
Thanks for the suggestion. I am being messing about with VALUES myself, but as far as I can tell it returns all of the values in the filtered table, regardless of whether they are selected or not.
So, if I have a table called t_Facility_Types. There's one column called Facility_Types and there are five rows, Cottage, House, Shed, Factory, Shop. If I display a slicer based on t_Facility_Types[Facility_Types] I get a check-list. Regardless of what I have checked, if I create a dynamic table with t_Filtered = VALUES(t_Facility_Types[Facility_Types]), then t_Filtered contains all 5 rows from the starting table.
Please correct me if I'm wrong but that's what seems to be happening.
- AnonymousNot applicable
Anyone got any further ideas? Really struggling with this.
- AnonymousNot applicable
Anonymous
Power bi slicer can only filter the visuals on the report page, there is no way to filter the data view table by a Slicer on the report page. But I found a relevant post, the solution may helps:https://community.powerbi.com/t5/Desktop/Creating-a-dynamic-summarized-table-or-calculated-table/td-p/196320For me, You can create a measure and put some columns and the measures in a table visual to make it as a dynamic table visual.
Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490