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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
reshma
New Member

Filtering a report using query string parameters in the URL - not working as expected

 

We are passing the filter in the url. Our table name has spaces so replaced the spaces with '_x0020_' 

 

URL used : https://app.powerbi.com/groups/********/reports/***********/ReportSection?filter=Organisation_x0020_... eq 'AAA HHHH'

 

When we open this url in browser, the report shows an empty graph and the filter drop down has only 'AAA HHHH' value and not as the selected value. When a user selects from the filter dropdown, the report refreshes and shows the correct report. 

By default the filter passed from the url should be the selected option and the report should show the results. Please help us to trouble shoot this issue.

 

3 REPLIES 3
GilbertQ
Super User
Super User

Hi there

When you pass through a URL report filter, it filters the data on the report level and not at the slicer level. That is why you are getting it appearing like it is not working.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

So, I should be using Slicer filter.

I am trying to set the Slicer filter using Javacript api. I am able to call setSlicerState function on visual.  How to get reference to the visual by id and and set the slicer state?.     

 

Here is my code 

const filter = {
target: {
table: "Organisation Source",
column: "Organisation Description"
},
operator: "In",
values: ["Gippsland - AMHS"],
};

var embedConfiguration = {
type: drupalSettings.powerbi.display,
id: pbi_id,
embedUrl: pbi_embedUrl,
pageName: pbi_section,
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: true
},
accessToken: drupalSettings.powerbi.accessToken,
};
 
var $reportContainer = $('#reportContainer');
 
if (pbi_embedUrl) {
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
report.on('rendered', () => {
report.getPages().then(pages => {
pages[0].getVisuals().then(function(visuals) { visuals[4].setSlicerState({filters:[filter]})});
});
});
 
}
else {
console.log('Embed Url is missing');
}

 

 

Hi there

To be totally honest I am not an embedded developer so I am not sure how this would work.

Hopefully someone who has that experience can help you.

You can possibly look at the Power BI Developer documents here: https://docs.microsoft.com/en-us/azure/power-bi-embedded/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors