Forum Discussion
Sync between custom filter and slicer
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
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
- ysapiyev8 years agoResponsive Resident
I'm quite confused about usage of Advanced filter.
In updateOnRangeSelectonChange there are several functions, which are located in sampleslicer.ts. Should I copy them to my code? Are they necessary?
I also tried to build filter using powerbi-models but import of powerbi-models failed with error: "import cannot have reference to module". How it can be resolved?
Regards,
Yerkhan