Forum Discussion

yforti's avatar
yforti
Helper II
2 years ago

Pass parameter to API through slicer filter

My data model is based on an API connection. After creating the API in Power M and applying it, I created the necessary visuals, however, I have a need:

Is there any way for the user using the panel to be able to pass the page parameter through a slicer filter to the API?

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, yforti 

    Power BI doesn't natively directly support dynamically passing slicer values back to the API endpoint, but you can achieve a similar effect by using Power BI's dynamic M-parameter feature and combining it with a service that supports dynamic queries, such as Azure Functions or a web service that you control. Set dynamic M-parameters in a Power BI report. These parameters can be bound to a slicer, allowing the user to control their values interactively. For dynamic M-parameters, you can check out the following documentation:

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

     

    Connect Power BI to a web service or Azure Function and pass dynamic M-parameters in the request instead of connecting Power BI directly to the original API.

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

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