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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
charlie77
Helper II
Helper II

Table filtered by slicer

Hi 

I wonder whether anyone could enlighten me on this - to get a filtered table based on slicer value. Say I have two tables:

States

State_ID State_Name

 

LG (for Local goverments in the states)

LG_ID LG_Name State_Name

 

The two tables have a relation linked by Stata_Name in both tables.

 

Table States has a slicer to allow users to select a state name. I then want to have a table SelectedLG with local government names in the selected state. It's appareanly a very easy job but somehow I can't implment it. Here was how I did in New Table with DAX :

 

SelectedLG=

   VAR SelectedState = SELECTEDVALUE(States, States[State_Name])

   Return

CALCULATETABLE(LG, LG[State_Name] = SelectedState)

 

It resulted in a empty table regardless which state I selected. However SELECTEDVALUE(States, States[State_Name]) does give the correct state name in a table visual, and I got a correct SelectedLG table if I replace the SELECTEDVALUE with the text of a state's name. 

 

Thanks

 Charlie 

 

 

1 ACCEPTED SOLUTION

Thank you. I get it. Actually my problem is bit more complex than this - the states and LGs are not a one to many realatioship. The LG is a kind of local geography that are poorly aligned with the states boundaries, that is, one LG may possibly cross 2 to 3 states. The problem I'm faced with is to apply the concordance data (i.e. proportions of a LG assigned to different containing states if it's not fully contained by one signle state) to LGs once a state is selected. I'll repost my problem as a new post. For this consider case closed. Thank you.

Charlie

View solution in original post

5 REPLIES 5
MFelix
Super User
Super User

Hi @charlie77,

You cannot create a new table using the value selected on slicer.

On this case if you place the slicer and on other visual place the LG names they will be filtered directly no need to create a new table.

Take attention that this is assuming a one to many relationship with single side filtering and you must use the one side tabke as your slicer.

Regards,
MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you. I get it. Actually my problem is bit more complex than this - the states and LGs are not a one to many realatioship. The LG is a kind of local geography that are poorly aligned with the states boundaries, that is, one LG may possibly cross 2 to 3 states. The problem I'm faced with is to apply the concordance data (i.e. proportions of a LG assigned to different containing states if it's not fully contained by one signle state) to LGs once a state is selected. I'll repost my problem as a new post. For this consider case closed. Thank you.

Charlie

Hi @charlie77 ,

 

If you want to close this case, you could accept your own reply or others.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
venal
Memorable Member
Memorable Member

@charlie77 

Can you please share the sample data and let us know the common column from the 2 tables to re-pro the issue from our end.

If possible please share the expected result.

Thanks for responding but I realised why it's not working having searched the community - a calculated table is static and will not respond to the slicer on the fly. I'll need to find another approach to my task. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.