Forum Discussion

AmarishJayanth's avatar
AmarishJayanth
New Member
1 year ago
Solved

ODATA service URL as dynamic parameter

I am in the process of preparing the dashboards in Power BI. The data source is ODATA services from SAP. I am able to successfully get the data from SAP using the ODATA service call in Power BI. Now,...
  • v-ssriganesh's avatar
    1 year ago

    Hi AmarishJayanth 

    Thanks for reaching out to the Microsoft fabric community forum.

    you can create a parameter in power query, then set the parameter 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 parameter to change the filter, you can only do it in power query or edit it in data source setting when the report is published to Service, you can refer to the following link.

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

    Sample data 

     

     

    Step1: Create a parameter in power query

     

     

    Step 2: Modify the ODATA Service URL:

    Open Power Query Editor by navigating to the "Home" tab and clicking on "Transform Data".
    Locate the query which retrieves data from the ODATA service.
    In the query, replace the static date in the ODATA service URL with the parameter you create. For example:

    let

        Source = OData.Feed("https://your-odata-service-url?date=" & Date.ToText(SelectedDate, "yyyy-MM-dd"))

    in

        Source

    Step3: Load the Data

      • Close and apply the changes in the Power Query Editor.
      • The data will now be filtered based on the selected date in the slicer.



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

     

    Hope this will help.

    Thank you.