Detect filter state
Note
This feature is available from API version 5.4
The isDataFilterApplied
boolean parameter in the DataViewMetadata
object notes if the rendered visual or report has any filters applied to it. The developer can then adjust the display accordingly (for example, by adding or removing text depending on if there's a filter). This feature applies whether the filter is applied to the entire report, page, or specific visual.
To use the isDataFilterApplied
parameter:
public update(options: VisualUpdateOptions) {
const dataView = options?.dataViews[0];
if (dataView && dataView?.metadata?.isDataFilterApplied) {
...
}
}
Related content
Use Power BI visuals selections to add interactivity to a visual
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for