Quantcast
Channel: All Developer posts
Viewing all articles
Browse latest Browse all 49342

Re: Using multiple AND conditions along with the filtered

$
0
0



A draft demo would like below. This demo would embed a report and apply a filter. It would require some javascript skill.

<html><script src="https://microsoft.github.io/PowerBI-JavaScript/demo/bower_components/jquery/dist/jquery.js"></script>  <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/bower_components/powerbi-client/dist/powerbi.js"></script><script src="https://microsoft.github.io/PowerBI-JavaScript/demo/bower_components/es6-promise/es6-promise.js"></script><script src="https://microsoft.github.io/PowerBI-JavaScript/demo/bower_components/fetch/fetch.js"></script><script type="text/javascript">
window.onload = function () {
var embedConfiguration = {
    type: 'report',
    accessToken: 'a valid token',
    id: '734503cf-xxxx-xxxx-xxxx-791d62c154ad',
    embedUrl: 'https://embedded.powerbi.com/appTokenReportEmbed?reportId=734503cf-xxxx-xxxx-xxxx-791d62c154ad' 
}; 

var $reportContainer = $('#reportContainer');
 
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
   

 afilter = {
  $schema: "http://powerbi.com/product/schema#advanced",
  target: {
    table: "tablename",
    column: "columname"
  },
  logicalOperator: "Or",
  conditions: [
    {
      operator: "Contains",
      value: "somevalue1"
    },
    {
      operator: "Contains",
      value: "somevalue2"
    }
  ]
}

report.on('loaded', event => {
                    report.getFilters()
                    .then(filters => {
                        filters.push(afilter);
                        return report.setFilters(filters);
                    })
                })

}
</script><div id="reportContainer"></div></html>

 


Viewing all articles
Browse latest Browse all 49342

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>