Forum Discussion
Support other visuals' selection in custom slicer
- 7 years ago
Hi,
To merge filtration, you should use applyJsonFilter with "merge" option.
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]
(I rebuilt report.)
I observe several problems with field options.jsonFilters in update method.
A) First of all I apply filters like following.
{
"$schema": "http://powerbi.com/product/schema#advanced",
"target": {
"table": "Data",
"column": "Type"
},
"filterType": 0,
"logicalOperator": "And",
"conditions": [
{
"operator": "Is",
"value": "Type2"
}
]
}But on next iteration options.jsonFilters contains another type of filter.
{
"$schema": "http://powerbi.com/product/schema#basic",
"target": {
"table": "Data",
"column": "Type"
},
"filterType": 1,
"operator": "In",
"values": [
"Type2"
]
}Is it normal behavior?
B) Does field options.jsonFilters contain filters applied by this visual only?
C) Are there any methods to compare filters in view of issue A?
D) In custom matrix visual field options.jsonFilters contains applied filters. But in custom slicer visual it is always empty. Why so?
A) It is a regular situation that filter looks not exactly the same as initial when you get it from options.jsonFilters .
It happens because filter will be converted into a query inside Power BI and then will be restored form this query when you receive it.
B) options.jsonFilters should contain all applied filters as I know.
C) I am not sure
D) It may happens if your custom visual uses an old API because jsonFilters appeared only in API 2.2 but it is better to use the latest API.
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]
- Anonymous7 years agoNot applicable
pbiviz.json of both projects contains
"apiVersion": "2.3.0"
May filters visibility depend on either type of filtered column or kind in dataRoles (capabilities.json)? It is Text in Grouping for custom matrix visual and Date in GroupingOrMeasure for custom slicer visual.
- v-evelk7 years agoMicrosoft Employee
No, I don't think so.
You can send the source code and the report to [email protected] and I will try to figure out what is wrong with filtration if you wish.
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]