Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Here's all the javascript:
// Read embed application token from Model
var accessToken = "@Model.EmbedToken.Token";
// Read embed URL from Model
var embedUrl = "@Html.Raw(Model.EmbedUrl)";
// Read report Id from Model
var embedReportId = "@Model.Id";
// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;
// Set up filter for Response ID
const filter = {
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: "ResponsesResultsUsers",
column: "Response ID"
},
operator: "In",
values: 26
}
// Embed configuration used to describe the what and how to embed.
// This object is used when calling powerbi.embed.
// This also includes settings and options such as filters.
// You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
var config = {
type: 'report',
tokenType: models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
permissions: models.Permissions.All,
filters: [filter],
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: false
}
};
// Get a reference to the embedded report HTML element
var reportContainer = $('#reportContainer')[0];
if ("@Model.Username" != "") {
$("#RLS").prop('checked', true);
$("#RLSdiv").show();
}
else
{
$("#RLS").prop('checked', false);
$("#RLSdiv").hide();
}
if ("@Model.IsEffectiveIdentityRequired.GetValueOrDefault()" == "True") {
$("#noRLSdiv").hide();
$("#RLS").removeAttr("disabled");
$("#RLS").change(function () {
if ($(this).is(":checked")) {
$("#RLSdiv").show(300);
} else {
$("#RLSdiv").hide(200);
}
});
}
else
{
$("#noRLSdiv").show();
}
// Embed the report and display it within the div container.
var report = powerbi.embed(reportContainer, config);
report = powerbi.get(reportContainer);
// Set the filter for the report.
// Pay attention that setFilters receives an array.
report.setFilters([filter])
.catch(function (errors) {
Log.log(errors);
});
It doesn't seem to recognize the "filters" property of the config object. The post-load application of the filter doesn't do anything either (if I comment out the "filters" property, then the report loads fine, but using the original value for "Response ID" not the one included in the "filter" contant declaration above.
It almost seems as though the filter support isn't included here. Could it be the use of powerbi-client vs. powerbi-models? the latter of which is referenced in the embedded filtering docs page.
i am facing an issue , when filter pane is hidden using updatesetting() api method , the filter pane appears when clicked inside report tiles , this looks like a bug from javascript library.anyone knows this issue or solution?
Hi @paulhyland,
The values could be in []. Please give it a try. Reference: https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters#constructing-filters
const filter = {
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: "ResponsesResultsUsers",
column: "Response ID"
},
operator: "In",
values: [26]
}
Best Regards,
Dale
Here's all the javascript:
// Read embed application token from Model
var accessToken = "@Model.EmbedToken.Token";
// Read embed URL from Model
var embedUrl = "@Html.Raw(Model.EmbedUrl)";
// Read report Id from Model
var embedReportId = "@Model.Id";
// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;
// Set up filter for Response ID
const filter = {
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: "ResponsesResultsUsers",
column: "Response ID"
},
operator: "In",
values: 26
}
// Embed configuration used to describe the what and how to embed.
// This object is used when calling powerbi.embed.
// This also includes settings and options such as filters.
// You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
var config = {
type: 'report',
tokenType: models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
permissions: models.Permissions.All,
filters: [filter],
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: false
}
};
// Get a reference to the embedded report HTML element
var reportContainer = $('#reportContainer')[0];
if ("@Model.Username" != "") {
$("#RLS").prop('checked', true);
$("#RLSdiv").show();
}
else
{
$("#RLS").prop('checked', false);
$("#RLSdiv").hide();
}
if ("@Model.IsEffectiveIdentityRequired.GetValueOrDefault()" == "True") {
$("#noRLSdiv").hide();
$("#RLS").removeAttr("disabled");
$("#RLS").change(function () {
if ($(this).is(":checked")) {
$("#RLSdiv").show(300);
} else {
$("#RLSdiv").hide(200);
}
});
}
else
{
$("#noRLSdiv").show();
}
// Embed the report and display it within the div container.
var report = powerbi.embed(reportContainer, config);
report = powerbi.get(reportContainer);
// Set the filter for the report.
// Pay attention that setFilters receives an array.
report.setFilters([filter])
.catch(function (errors) {
Log.log(errors);
});
It doesn't seem to recognize the "filters" property of the config object. The post-load application of the filter doesn't do anything either (if I comment out the "filters" property, then the report loads fine, but using the original value for "Response ID" not the one included in the "filter" contant declaration above.
It almost seems as though the filter support isn't included here. Could it be the use of powerbi-client vs. powerbi-models? the latter of which is referenced in the embedded filtering docs page.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |