Forum Discussion
Error "slicerTargetDoesNotMatch" while embedded report with custom visual slicer loads
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]
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