Skip to main content
Microsoft Idea

Power BI

Needs Votes

Allow setting of Slicer State at report level - without having to find individual visual objects

Vote (1) Share
Power BI Ideas Admin's profile image

Power BI Ideas Admin on 16 Jun 2020 21:38:27

Power BI Embedding allows for slicer state to be set when initial embedding is performed. An array of ISlicer objects can be passed into an IEmbedConfiguration - targeting slicers by table/column names.

After embedding has completed, the only way to update a slicers state is to use 'setSlicerState' on each individual visual. As described here: https://github.com/Microsoft/PowerBI-JavaScript/wiki/Slicers#set-slicer-state

This requires a developer to iterate through the report object hierarchy (Report -> Pages -> Visuals) iterating over the visuals to find the target slicer by ID or Name.

Both ID and Name are problematic at times (ID is random, and names have a habit of changing). The code to loop through the report hierarchy is also very verbose.

Idea/Suggestion:
Allow updates to visual slicers to be done at the report object level - using an array - matching the functionality of the initial configuration object allowing targeting by slicer binding (table/column).

e.g.

const mySlicers: pbi.models.ISlicer[] = buildSlicerObjects () ;
report.setSlicers(mySlicers);

Comments (1)
Power BI Ideas Admin's profile image Profile Picture

Power BI Ideas Admin on 06 Jul 2020 00:16:42

RE: Allow setting of Slicer State at report level - without having to find individual visual objects

I agree, this would be a useful update