Forum Discussion
Selected slicer
- Anonymous1 year ago
Hi Anonymous
To handle the scenario based on the slicer selection from a disconnected table (ANZSIC_Level_Selector), the following measure can be used to conditionally show rows depending on which level is selected:
Show Row? =
VAR SelectedLevel = SELECTEDVALUE('ANZSIC_Level_Selector'[SelectedLevel])
RETURN
SWITCH(
TRUE(),
SelectedLevel = "ANZSIC Level 1", NOT(ISBLANK('Data Table'[ANZSIC Level 1])),
SelectedLevel = "ANZSIC Level 2", NOT(ISBLANK('Data Table'[ANZSIC Level 2])),
SelectedLevel = "ANZSIC Level 3", NOT(ISBLANK('Data Table'[ANZSIC Level 3])),
TRUE(), 1
)This measure shows 1 only for rows where the selected slicer level's column isn't blank, with a fallback to handle no selection. Add it to your table visual and filter for Show Row? = 1 to display only relevant rows.
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Sreeteja.
Community Support Team
Hello Anonymous
try this
Create a Disconnected Table
Go to "Enter Data" and create a table like this:
LevelName |
ANZSIC Level 1 |
ANZSIC Level 2 |
ANZSIC Level 3 |
ANZSIC Level 4 |
ANZSIC Level 5 |
Name it ANZSIC_Level_Table.
Add a Slicer
Use the LevelName column from ANZSIC_Level_Table in a slicer visual.
Create a Measure to Dynamically Show the Selected Level's Data
Selected ANZSIC Value =
VAR SelectedLevel = SELECTEDVALUE('ANZSIC_Level_Table'[LevelName])
RETURN
SWITCH(
SelectedLevel,
"ANZSIC Level 1", SELECTEDVALUE('YourDataTable'[Level 1]),
"ANZSIC Level 2", SELECTEDVALUE('YourDataTable'[Level 2]),
"ANZSIC Level 3", SELECTEDVALUE('YourDataTable'[Level 3]),
"ANZSIC Level 4", SELECTEDVALUE('YourDataTable'[Level 4]),
"ANZSIC Level 5", SELECTEDVALUE('YourDataTable'[Level 5]),
BLANK()
)
Replace 'YourDataTable' with the actual name of your main table.
Use the Measure in Matrix
Place the dimension you want on Rows (e.g., IDs, categories).
Use Selected ANZSIC Value measure in the Values section.
Thanks
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
Hi Pankaj Thanks for your responce
i created with this measure previously
VAR SelectedLevel = SELECTEDVALUE('ANZSIC_Level_Table'[LevelName])
RETURN
SWITCH(
SelectedLevel,
"ANZSIC Level 1", SELECTEDVALUE('YourDataTable'[Level 1]),
"ANZSIC Level 2", SELECTEDVALUE('YourDataTable'[Level 2]),
"ANZSIC Level 3", SELECTEDVALUE('YourDataTable'[Level 3]),
"ANZSIC Level 4", SELECTEDVALUE('YourDataTable'[Level 4]),
"ANZSIC Level 5", SELECTEDVALUE('YourDataTable'[Level 5]),
BLANK()
)
what what are all the data available in the matrix visual is not changing if we select any anzsic levels from the slicer in power BI
i have added the data column in the dax also it is not changing this is the dax i have used
- Anonymous1 year agoNot applicable
Hi Anonymous ,
Try These Steps to resolve.
Add Disconnected Slicer Table
SelectedLevel
---------------------
ANZSIC Level 1
ANZSIC Level 2
ANZSIC Level 3Name this table: ANZSIC_Level_Selector
Do not link this table to Data Table (keep it disconnected).
Create Dynamic Measure
Selected Response =
VAR SelectedLevel = SELECTEDVALUE('ANZSIC_Level_Selector'[SelectedLevel])
RETURN
SWITCH(
SelectedLevel,
"ANZSIC Level 1", MAX('Data Table'[ANZSIC Level 1 Response]),
"ANZSIC Level 2", MAX('Data Table'[ANZSIC Level 2 Response]),
"ANZSIC Level 3", MAX('Data Table'[ANZSIC Level 3 Response]),
BLANK()
)
Add Visuals
1. Add a Slicer:
Drag SelectedLevel from the ANZSIC_Level_Selector table into the slicer.2. Add a Matrix visual:
Rows: Drag ID from the Data Table
Values: Drag the measure Selected Response
Find the below attached .pbix file for your reference.If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Sreeteja.
Community Support Team- Anonymous1 year agoNot applicable
Hi Sreeteja thanks for your responce
i have only only one (calculated/measure) responce column when i tried the dax data is not filtering for the particular Anzsic filters it is showing same data for all the filters- Anonymous1 year agoNot applicable
Hi Anonymous
To handle the scenario based on the slicer selection from a disconnected table (ANZSIC_Level_Selector), the following measure can be used to conditionally show rows depending on which level is selected:
Show Row? =
VAR SelectedLevel = SELECTEDVALUE('ANZSIC_Level_Selector'[SelectedLevel])
RETURN
SWITCH(
TRUE(),
SelectedLevel = "ANZSIC Level 1", NOT(ISBLANK('Data Table'[ANZSIC Level 1])),
SelectedLevel = "ANZSIC Level 2", NOT(ISBLANK('Data Table'[ANZSIC Level 2])),
SelectedLevel = "ANZSIC Level 3", NOT(ISBLANK('Data Table'[ANZSIC Level 3])),
TRUE(), 1
)This measure shows 1 only for rows where the selected slicer level's column isn't blank, with a fallback to handle no selection. Add it to your table visual and filter for Show Row? = 1 to display only relevant rows.
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Sreeteja.
Community Support Team