0
votes

I am making an Embed class that uses PowerBI Javascript. I am already filtering reports dinamically using a schema of a basic filter and an advanced filter.

In my page, I will also want to embed a dashboard or a single/multiple tiles. I want this dashboard or tiles to be filtered using the same schemas that I use in report. I searched around and saw that there's no way of direct filtering a dashboard or a tile using the schema Filters the same way I use in the report.

If this doesnt work, my best solution to embed tiles that are already filtered with custom filters, will be to use Visuals and instead of having dashboards or tiles I should use the Visuals of a report and this way I can use custom filters directly applied on them.

But is there another way around into filtering dashboard or tiles?

I can do this in a report. But is there any other way I can do this in a tile or a dashboard?

const basicFilter = {
            $schema: "http://powerbi.com/product/schema#basic",
            target: {
                table: data.filter.table,
                column: data.filter.column
            },
            operator: "In",
            values: [data.filter.userId],
            filterType: 1,
            displaySettings: {
                isLockedInViewMode: true,
                isHiddenInViewMode: true,
                displayName: "Logged in User"
            }
            //requireSingleSelection: true // Limits selection of values to one.
        };

        // Note, this is always an array!
        config.filters = [basicFilter];
1

1 Answers

2
votes

Filtering Dashboards and Tiles is not supported in PowerBI JavaScript.

But, yes the solution you stated can be considered as a workaround. You can refer here to see how to apply report level filter for whole report, page level filters for a particular page and visual level filters for a particular visual.

You can also refer to the PowerBI Embedded Playground for some implementation help.