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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

URL parameters to Power BI parameters in Power BI service

Is it possible to pass parameters from a URL to a Power BI report in Power BI service to a Direct Query and load data and report based of those parameters?

 

I have reviewed the URL filter documentation, but as far as I understand this only works on imported data. I cannot import the data then filter it because it is too big. I need to pull a small subset of data on demand using Direct Query from Power BI service. I cannot for the life of me figure out if this is possible and how to do it.

 

This would be baffling if Power BI can't do this as it is not a difficult task in Tableau. Hoping someone from the community can assist.

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on my tests, the URL filter works in Direct Query mode. Here is my sample data.

a2.PNG

 

Then you may add some filters like follows.

 

?filter=Student/Name eq 'Mike'

 

 

Result:

a3.PNG

 

I'd like to suggest you pay attention to the considerations and troubleshooting in the document .

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Are you certain you are actually refreshing the query and not just filtering pre-loaded data? I did try this. If the data is already loaded into Power BI, this works, but it will not refresh the query. In fact things just go blank because Power BI cannot find the data for the given filter since it is not actually refreshing the query. The considerations have nothing about using parameters instead of filters. Can you clarify what considerations you're referring to?

 

Default Client value before attempting filter:

ALBR_PA.png

 

After adding to url ?filter=Client/Client eq 'UNIV_MO'. As you can see Client is blank because the value does not exist in data set and Direct Query did not refresh with new value.

UNIV_MO.png

Hi, @Anonymous 

 

My data source is Sql Server database with Direct Query mode. I add a new record where name is 'S'. 

a1.png

a2.png

 

Then I add a url filter as below.

?filter=Student/Name eq 'S'

 

Result:

a3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Any chance you can show me what your query looks like? It will help me verify mine is set up correctly because I can't get this to work.

Hi, @Anonymous 

 

The query is simple.

a1.png

 

Best Regards

Allan

Anonymous
Not applicable

Thanks for sharing. My issue is not using URL filters in direct query mode, it is using parameters. I would like to take a parameter from the URL (parameters are different than filters), feed it into my query in Power BI, and have Power BI refresh with new data based on those parameters.

 

Since your loading the entire data set into Power BI your simply filtering the pre-loaded data. As explained in original post, this won't work for me as my data set is too big. If you add a parameter into your direct query based on name you will see the problem I am having.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors