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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
pearl
Frequent Visitor

Dynamic parameter values in Odataservice URL in Power BI

Dear Experts, 

I need your help with the following scenario. 

I am fetching data from SAP S4 HANA CDS Views into Power BI through Odataservice. The Odataservice URL has the parameter values hardcoded, which is why my report shows data only for that particular value. To be more specific, company code is the parameter which is getting data only for one value say 1000. I want to make this dynamic and allow users to enter whatever Company code value they want and the report should be able to display it. Can someone please help me with the issue.

You help is much appreciated.

 

Thank you in advance.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pearl 

If your connect mode is direct query, you can create a paramater in power query, then set the paramater with slicer, you can refer to the following link.

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

The following sample cannot allow the user to input the parameter, if you want to edit the paramater to change the filter, you can only do it in power query or edit it in data source setting when the report is publised to Service, you can refer to the following link.

Edit parameter settings in the Power BI service - Power BI | Microsoft Learn

Sample data 

vxinruzhumsft_0-1703480879838.png

 

Step1 Create a paramater in power query

vxinruzhumsft_1-1703480918449.png

 

Step 2:

Put the paramater to the code

let
  para="?$filter=EmployeeID eq "&Text.From(Parameter1),
  Source = OData.Feed("https://services.odata.org/V3/Northwind/Northwind.svc/Employees"&para, null, [Implementation="2.0"])
in
    Source

 

Best Regards!

Yolo Zhu

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
Anonymous
Not applicable

Hi @pearl 

If your connect mode is direct query, you can create a paramater in power query, then set the paramater with slicer, you can refer to the following link.

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

The following sample cannot allow the user to input the parameter, if you want to edit the paramater to change the filter, you can only do it in power query or edit it in data source setting when the report is publised to Service, you can refer to the following link.

Edit parameter settings in the Power BI service - Power BI | Microsoft Learn

Sample data 

vxinruzhumsft_0-1703480879838.png

 

Step1 Create a paramater in power query

vxinruzhumsft_1-1703480918449.png

 

Step 2:

Put the paramater to the code

let
  para="?$filter=EmployeeID eq "&Text.From(Parameter1),
  Source = OData.Feed("https://services.odata.org/V3/Northwind/Northwind.svc/Employees"&para, null, [Implementation="2.0"])
in
    Source

 

Best Regards!

Yolo Zhu

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

 

Hello Yolo Zhu,

 

Thank you for the response. That worked actually. 

 

Best Regards,

Pearl

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors