Reply
gabriel-mendes
Regular Visitor

Pass Parameter via URL for Data Filtering in Power Query

Hi Community

 

I use PowerQuery to filter the datasource directly on that level for my visuals.

This works great, but I would like to pass this parameter (string) in the URL.

 

The parameter I have created is called "CostCenter".

Then I use "CostCenter" in the table to already filter only the rows that I require.

It filters all the data in the report, which is great.

I use Power-BI Embedded and the Direct Query Mode.

 

Can you help me to pass this value in the URL?

 

Many thanks!

 

SCR-20240907-ktcc.png

 

SCR-20240907-kvhn.png

1 ACCEPTED SOLUTION
v-junyant-msft
Community Support
Community Support

Hi @gabriel-mendes ,

From my knowledge, I am afraid that your requirement is unattainable. According to the screenshot you provided, your parameter was created in Power Query, and in general, a parameter in Power Query can only work in Power Query, it can't even be passed to Power BI Desktop, much less to Power BI Embedded.

You mentioned that your connection mode is Direct Query, and that connection mode does have a way to pass the parameters you create in Power Query for use in Power BI Desktop, but that method has numerous limitations. I'm not sure how your parameter was created, so I'm not sure if it works.
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
If this method works, you can try to publish the parameter in your report as mentioned in the documentation, and then embed the report, but the final embedding result should not be what you want, because this method requires you to go back to Power BI Service and modify the parameter manually before you can display the data corresponding to the other parameter.

Currently the only parameters that can be applied in the report URL should be those mentioned in the documentation like the one below. Can you check if this is an alternative?
Filter a report using query string parameters in the URL - Power BI | Microsoft Learn

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

View solution in original post

2 REPLIES 2
v-junyant-msft
Community Support
Community Support

Hi @gabriel-mendes ,

From my knowledge, I am afraid that your requirement is unattainable. According to the screenshot you provided, your parameter was created in Power Query, and in general, a parameter in Power Query can only work in Power Query, it can't even be passed to Power BI Desktop, much less to Power BI Embedded.

You mentioned that your connection mode is Direct Query, and that connection mode does have a way to pass the parameters you create in Power Query for use in Power BI Desktop, but that method has numerous limitations. I'm not sure how your parameter was created, so I'm not sure if it works.
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
If this method works, you can try to publish the parameter in your report as mentioned in the documentation, and then embed the report, but the final embedding result should not be what you want, because this method requires you to go back to Power BI Service and modify the parameter manually before you can display the data corresponding to the other parameter.

Currently the only parameters that can be applied in the report URL should be those mentioned in the documentation like the one below. Can you check if this is an alternative?
Filter a report using query string parameters in the URL - Power BI | Microsoft Learn

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

PwerQueryKees
Super User
Super User

We need more information, like:

  • What database do you connect to?
  • What is Powerquery M Code you use to connect to your database?
  • What does the url currently look like? 
avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)