Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
chotu27
Post Patron
Post Patron

power bi embedded

Hi,

I am integrating power bi to my web application , So i have 5 Types diffrent stores which are able to select from application that stores are also available in my dataset in power bi . So now i need wheather we can pass the parameters from application to power bi to filter according to stores selected from the application .

 

Is this possible
?????????????????? 

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee


@chotu27 wrote:

Hi,

I am integrating power bi to my web application , So i have 5 Types diffrent stores which are able to select from application that stores are also available in my dataset in power bi . So now i need wheather we can pass the parameters from application to power bi to filter according to stores selected from the application .

 

Is this possible
?????????????????? 


@chotu27

It is possible, you could use the Power BI Javascript API, see Filters. A demo for your reference. Note that the table name and column name are case sensitive.

 

<html>

<script src="JQuery.js"></script>
<script src="powerbi.js"></script>

<script type="text/javascript">
window.onload = function () {
 // Read embed application token from Model
    var accessToken = "H4sIAAxxxxxxxxxxxxxuoLAAA=";

    // Read embed URL from Model
    var embedUrl = "https://app.powerbi.com/reportEmbed?reportId=5146cfxxxxxa469caab581&groupId=dc581184-xxxx32f16b6c15";

    // Read dashboard Id from Model
    var embedReportId = "51xxxaab581";

    // Get models. models contains enums that can be used.
    var models = window['powerbi-client'].models;

    // 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  filter1 = {
   $schema: "http://powerbi.com/product/schema#advanced",
  target: {
    table: "Table1",
    column: "storename"
  },
  logicalOperator: "OR",
  conditions: [
    {
      operator: "Contains",
      value: "store1"
    } 
  ]
}

    var config = {
        type: 'report',
        tokenType: models.TokenType.Embed,
        accessToken: accessToken,
        embedUrl: embedUrl,
        id: embedReportId,	
	filters:[filter1], // the filters is an array here, you can add more filter like [filter1,filter2,filter3]
	settings: {
                filterPaneEnabled: true //hide the filterPane so that your user can't change the filter to see more data, this is not a strong security, anyone who's familar with javascript can bypass it
		}
    };

    // Get a reference to the embedded dashboard HTML element
    var dashboardContainer = $('#reportContainer')[0] ;

    // Embed the dashboard and display it within the div container.
    var dashboard = powerbi.embed(dashboardContainer, config);
 
}
 
 
</script> 
 
<div id="reportContainer"></div>

</html>  

 

View solution in original post

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee


@chotu27 wrote:

Hi,

I am integrating power bi to my web application , So i have 5 Types diffrent stores which are able to select from application that stores are also available in my dataset in power bi . So now i need wheather we can pass the parameters from application to power bi to filter according to stores selected from the application .

 

Is this possible
?????????????????? 


@chotu27

It is possible, you could use the Power BI Javascript API, see Filters. A demo for your reference. Note that the table name and column name are case sensitive.

 

<html>

<script src="JQuery.js"></script>
<script src="powerbi.js"></script>

<script type="text/javascript">
window.onload = function () {
 // Read embed application token from Model
    var accessToken = "H4sIAAxxxxxxxxxxxxxuoLAAA=";

    // Read embed URL from Model
    var embedUrl = "https://app.powerbi.com/reportEmbed?reportId=5146cfxxxxxa469caab581&groupId=dc581184-xxxx32f16b6c15";

    // Read dashboard Id from Model
    var embedReportId = "51xxxaab581";

    // Get models. models contains enums that can be used.
    var models = window['powerbi-client'].models;

    // 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  filter1 = {
   $schema: "http://powerbi.com/product/schema#advanced",
  target: {
    table: "Table1",
    column: "storename"
  },
  logicalOperator: "OR",
  conditions: [
    {
      operator: "Contains",
      value: "store1"
    } 
  ]
}

    var config = {
        type: 'report',
        tokenType: models.TokenType.Embed,
        accessToken: accessToken,
        embedUrl: embedUrl,
        id: embedReportId,	
	filters:[filter1], // the filters is an array here, you can add more filter like [filter1,filter2,filter3]
	settings: {
                filterPaneEnabled: true //hide the filterPane so that your user can't change the filter to see more data, this is not a strong security, anyone who's familar with javascript can bypass it
		}
    };

    // Get a reference to the embedded dashboard HTML element
    var dashboardContainer = $('#reportContainer')[0] ;

    // Embed the dashboard and display it within the div container.
    var dashboard = powerbi.embed(dashboardContainer, config);
 
}
 
 
</script> 
 
<div id="reportContainer"></div>

</html>  

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.