We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Is is possbile to get all possible filter values, i wanted to get values selected and not selected values ?
Solved! Go to Solution.
Based on my test, we can only get the filter objects as in this wiki, NOT all values.
<html>
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script>
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script>
<script type="text/javascript">
window.onload = function () {
var embedConfiguration = {
type: 'report',
accessToken: 'exxxxxxxxxxxxxA',
id: 'c94a6db4-e077-4dde-861a-7c7d22116451',
embedUrl: 'https://app.powerbi.com/reportEmbed'
};
var $reportContainer = $('#reportContainer');
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
var reportPages;
report.on('dataSelected', function(event)
{
var data = event.detail;
console.log(JSON.stringify(data, null, ' '));
});
report.on('loaded', function(event)
{
report.getFilters().then(function(filters)
{
console.log(filters[0]);
});
});
}
</script>
<div id="reportContainer"></div>
</html>
Based on my test, we can only get the filter objects as in this wiki, NOT all values.
<html>
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script>
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script>
<script type="text/javascript">
window.onload = function () {
var embedConfiguration = {
type: 'report',
accessToken: 'exxxxxxxxxxxxxA',
id: 'c94a6db4-e077-4dde-861a-7c7d22116451',
embedUrl: 'https://app.powerbi.com/reportEmbed'
};
var $reportContainer = $('#reportContainer');
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
var reportPages;
report.on('dataSelected', function(event)
{
var data = event.detail;
console.log(JSON.stringify(data, null, ' '));
});
report.on('loaded', function(event)
{
report.getFilters().then(function(filters)
{
console.log(filters[0]);
});
});
}
</script>
<div id="reportContainer"></div>
</html>
Ok, thanks
Will make a feature request, need all values for my filter controls(filter dropdowns etc.)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |