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.
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
Solved! Go to 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
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank 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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |