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
答案 0 :(得分:0)
这是我在PowerBI报告页面深入挖掘后发现的。
您可以从报告页面控制台使用JS或JQuery访问过滤器,如下所示:
document.getElementsByClassName("ng-not-empty item-fill")
或
$("input.ng-not-empty.item-fill")
但是在Power BI中,每个visual都是一个嵌入式框架,所以据我所知你无法从嵌入式文档中访问父文档,如果有办法访问父文件那么问题就解决了!