I am currently having a problem with my filtering in an embedded PBI report. I was wondering if someone knows how to fix it.
In my report I would like to implement a filter that looks like this: An Advanced filtering where you can select between two dates with operators ‘is on or after”and ‘is on or before’.
If I Implement this filter on table ‘Zorgactiviteit datum’ and column ‘Datum’, it does not seem to work. The filter in Power BI Embedded is in the code below.
const filter = {
$schema: "http://powerbi.com/product/schema#advanced",
target: {
table: "Zorgactiviteit datum",
column: "Datum"
},
logicalOperator: "And",
conditions: [
{
operator: "IsOrAfter",
value: new Date().getDate() - 30
},
{
operator: "IsOnOrBefore",
value: new Date()
}
],
filterType: models.FilterType.AdvancedFilter
};
try {
await report.updateFilters(models.FiltersOperations.Add, [filter]);
console.log("Report filter was added.");
}
catch (errors) {
console.log(errors);
}
What I already did was:
1: Different operators that are normal for an advanced filter: LessThanOrEqual or GreaterThanOrEqual.
2: I tried the filter on the report and on the page.
user24704231 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.