Forum Discussion
Error "slicerTargetDoesNotMatch" while embedded report with custom visual slicer loads
Hello,
I have implemented a custom visual slicer and want to appy a filter (ISlicer with selector of type slicerTargetSelector) to that slicer in embed configuration on report load. Before the report finishes loading the error "slicerTargetDoesNotMatch" is logged in the browser console. The target is correct because with the standard slicer it works.
Is there something missing or exists a limitation?
Thanks in advance.
10 Replies
- v-evelkMicrosoft Employee
Hello,
Are you talking about embeded API configuration? Could you please provide more details and probably screens regarding your issue?
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]- FrankSindermannFrequent Visitor
Hello,
yes the power bi report should be loaded with power bi embedded API.
The error event handler of the report object is called while loading the report:
var reportContainer = document.getElementById('reportContainer'); var report = powerbi.load(reportContainer, embedConfig); report.on("error", function (event) { console.log(event); });The slicer state in the embed configuration object:
{ "selector": { "$schema": "http:\/\/powerbi.com\/product\/schema#slicerTargetSelector", "target": { "column": "Overdue Wesentlichkeit", "table": "Overdue Wesentlichkeit" } }, "state": { "filters": [{ "$schema": "http:\/\/powerbi.com\/product\/schema#advanced", "filterType": 0, "target": { "column": "Overdue Wesentlichkeit", "table": "Overdue Wesentlichkeit" }, "conditions": [{ "operator": "GreaterThan", "value": 2000.0000000000 } ], "logicalOperator": "And" } ] } }The output of the error event in the browser console looks like this:
With a breakpoint in the error event handler I can see that when the error is fired the constructor of the custom visual is not yet called.
Calling setSlicerState on the visual after report finished rendering no such error is thrown.
The error does not only occur with my custom visual but also e.g. with sample slicer from Microsoft (https://github.com/microsoft/powerbi-visuals-sampleslicer)
Thanks
- v-evelkMicrosoft Employee
Hello,
I see that column name and table name in the target object are the same. Is it correct?
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]