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.
I have a map-based visual that supports spatial filtering. Currently, if I draw a spatial filter, the points within the filter are added to the current selection, and other visuals are properly cross-filtered.
The problem is if my spatial filter returns no points. If I clear the selection set, all values are displayed in the other visuals. Is there a way I can manipulate the current selection so that no records are displayed in the other visuals? Maybe a "null" selection id that references no existing record?
Solved! Go to Solution.
I don't think so since it isn't the common workflow for Power BI.
If not items are selected that means all of items must be shown in other visuals.
Our recommendation is to follow the common workflow in order not to confuse users.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
How do you generate SelectiId?
You might create empty SelectionId and try to use it.
Please note common practice is to show all of values if no values are selected.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
I wasn't sure how to construct a null selectionId. I just created a new instance of SelectionId with no parameters. Adding this to the selection did the same as clearing all selection - it showed all values.
Is there a way to create a fake selection Id? One where the criteria in the key returns no result - like "column=-1" where it is guaranteed that column > 0?
I don't fully understand selection id's and identities as documentation on these objects is pretty slim. They all seem to be generated for us, so creating a fake one is foreign territory.
One other thing - I am using a table dataview instead of categorical. Not sure if that makes a difference. I used your suggestion in another thread to generate the table dataview selection Ids.
You might try to generate a selection by callig ISelectionIdBuilder.withMeasure("Some_faked_value").createSelectionId();
Please let us know if that works as you expected.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Thanks for the suggestion, but unfortunately it didn't work. I created a fake selection id by setting a fake value in the withMeasure() method, but adding that selection id to the selection set still caused all records to display.
I wonder if, because I am using a table dataview, there are no measures, and so the fake selection id is ignored. Am I able to create a selection id that goes against an existing column of the table, but with a fake value specified?
I don't think so since it isn't the common workflow for Power BI.
If not items are selected that means all of items must be shown in other visuals.
Our recommendation is to follow the common workflow in order not to confuse users.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
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 |
---|---|
14 | |
2 | |
2 | |
1 | |
1 |