Forum Discussion
andres777
Advocate III
6 years agoPower BI Custom Visuals binding to Report Calendar
Hi Dev friends, I'm writing my first Custom Visual this week in Power BI using the new v3 of "powerbi-visuals-api". It's a Calendar Datepicker that allows a selection of a single date, defaults to ...
andres777
Advocate III
6 years agoThe help found so far is this recent document...
https://docs.microsoft.com/en-us/power-bi/developer/visuals/filter-api
and
Sample:
https://github.com/microsoft/powerbi-visuals-streamgraph/blob/master/src/visual.ts#L552-L556
I was trying to use the BasicFilter, with applyJasonFilter
but ended up using Advanced Filter passing both start and end dates to be the same.
converted dates with .... value: start.toISOString().
let advancedFilter = new AdvancedFilter(this.filterTarget, "And", [{
operator: "GreaterThanOrEqual",
value: start.toISOString()
}, {
operator: "LessThan",
value: end.toISOString()
}])
//applyJsonFilter(filter: powerbi.IFilter | powerbi.IFilter[], objectName: string, propertyName: string, action: powerbi.FilterAction): void
this.host.applyJsonFilter(advancedFilter, "general", "filter", powerbi.FilterAction.merge);Thanks Ilfat Galief from Microsoft for your help.