Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am using the Javascript API to embed a powerbi report however the filter is not affecting the result. The code is as follows:
function getFilters () { const filter1 = {$schema: "http://powerbi.com/product/schema#basic",target: {table: "Users",column: "ID"},operator: "In",values: ["470"]}; var allFilters = [filter1]; return allFilters; }
The above function is called from an updateEmbededDashboard function that contains
report.getFilters() .then(function(filters) { var allFilters = getFilters(); filters.push(allFilters); if (allFilters != null) return report.setFilters(allFilters); }).catch (function (error) { console.log(error.message); });
Solved! Go to Solution.
In case anyone else comes accross this:
The issue was having the numeric value in double quotes. Instead of
operator: "In",values: ["470"]};
It should be
operator: "In",values: [470]};
In case anyone else comes accross this:
The issue was having the numeric value in double quotes. Instead of
operator: "In",values: ["470"]};
It should be
operator: "In",values: [470]};
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
2 |
User | Count |
---|---|
8 | |
6 | |
4 | |
4 | |
4 |