Forum Discussion
Sync between custom filter and slicer
How do you apply selection/filter in your custom visual?
The slicer doesn't react on any kind of selection if is's applied via SelectionManager.
We would recommend to start using Advanced Filter API.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
I'm using selection manager.
To use advanced filter API, I should updateOnRangeSelectionChange formula with my own conditions, right? What it will return?
Regards,
Yerkhan
- v-viig8 years agoCommunity Champion
You are correct. The updateOnRangeSelectonChange should be modified but it will return nothing as type is void.
The purpose of this function is to generate an IAdvancedFilter and apply it via applyAdvancedFilter.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- ysapiyev8 years agoResponsive Resident
I've found some code:
const relativeDateFilter: pbi.models.IRelativeDateFilter = { $schema: "http://powerbi.com/product/schema#relativeDate", target: { table: "Sales", column: "OrderDate" }, operator: pbi.models.RelativeDateOperators.InLast, timeUnitsCount: 30, timeUnitType: pbi.models.RelativeDateFilterTimeUnit.Days, includeToday: true, filterType: pbi.models.FilterType.RelativeDate };Can I use it in filter? I want to be able to select last week. month, year.
Regards,
Yerkhan.
- v-viig8 years agoCommunity Champion
Yes, I think so.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals