Abdallah Ali
Abdallah Ali

Reputation: 69

Power BI custom visual filters detection and clearing

I'm building a custom visual on Microsoft Power BI using d3.js.

My visual has a filter effect, i.e., when the user select filters it will change some properties style and will add new items.

The problem in Power BI that I can't detect if there is filters applied when the page/visual loaded also I can't retrieve the non filtered data if there is a filters allied.

Is there a way to detect if there is a filter and to retrieve the original data even if there is a filters applied?

Thanks

Upvotes: 0

Views: 416

Answers (1)

Abdallah Ali
Abdallah Ali

Reputation: 69

This what I found after drill-down in PowerBI report page.

You can access the filters using JS or JQuery from the report page console as follow:

document.getElementsByClassName("ng-not-empty item-fill")

or

$("input.ng-not-empty.item-fill")

but in Power BI each visual is an embedded frame so as far as I know you can't access the parent document from embedded document, if there is a way to access the parent so problem solved!!

Upvotes: 0

Related Questions