cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

Slicer value to web api

Hello Experts,

 

Need your help! I have created a pbi report with data source as web api. Also I have created a slicer with all distinct values of departments from one table. Now the question is how do I pass the selected depratment value from slicer to this web api? web api is written in C# and would return the data for that departmnet.

 

Any help is highly appreciated!

 

Thank you!

 

7 REPLIES 7
Microsoft
Microsoft

Hi @harshadsp,

 

It is not possible to pass slicer selection to data source (Web API). The slicer works to filter displayed data on report view, rather than filter the loaded dataset.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-yulgu-msft for the confirmation. I was thinking another way that I will create a icon and provide the link for the data filter but I guess that will open the another report. Is there any workaround that I can display in the same report.

 

Please advise. Thanks!

Hi @harshadsp,

 

It is not possible to pass slicer value to query string to dynamically change loaded dataset. One thing you should be aware of is that:

Power BI load data via Power Query first, then, add data from dataset into report view. Slicer displays value on report view, which is generated afterwards Power Query execution.

 

As a workaround, you can consider using Query Parameter which is used for Power Query, dynamically loading data based on specified value for parameter.

Power BI Desktop Query Parameters, Part 1

Using Parameters in Power BI

 

One limitation to this workaround is that end viewers you share report with via Power BI Service cannot change the parameter value.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-yulgu-msft for your suggestion and links. I somehow manage to create a function on top of web api url and then invoked a custom column for this function by passing the other column values as a parameter to function. Then put the other column in slicer. Now what user see is if he click on any slcier value the other graph renders for that value. Acyually the jason is already parsed from url for all the values but it visually effects what he wants.

 

I will go though the links and try to use the logic with other report.

 

Thank you so much for your time & efforts, I appreciate it!

 

Harshad

Hi @harshadsp,

 

I'm afraid such a requirement is not available now.

 

  1. It is not supported to pass any slicer value to Power Query.
  2. The only parameter that can be passed to Power Query is Query Parameter mentioned above.
  3. "Now what user see is if he click on any slcier value the other graph renders for that value."—— Query parameter is not accessable to end users. They are not able to select parameter values. As the edit box for parameter is hosted on the top ribbon in desktop, but end users can only see the report page. 

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-yulgu-msft for this complete insights! I will try using this.

Post Patron
Post Patron

Hello all, any thoughts? Please help, thanks

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session Drive Data Culture with Power BI: Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors