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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Read value from Report URL

Hi guys, 

 

I've done a lot of research but could not find any conclusive data about this. 

We are working on deciding a BI tool for one of our customers. The model is basically a Web App that resides on-premise, which will need to embed a set of Power BI reports, which will be connected to a HANA database in the cloud (SCP). 

 

This is all achievable, except for one important thing, which is communication between the web app and the embedded report. 

 

The main challenge is that the HANA models (based on calculation views), they all use HANA input parameters in the lowest level joins to filter data from the bottom. These input parameters are nothing but prompts that you pass to the database when you call a calculation view, and the populated value is used to restrict the SQL clause. 

 

I know we can call a Power BI report in an iFrame and pass filters to it in the URL, but this only restricts the data set after import, which makes it unusable to us. We would be returning ALL data everytime a user runs the app (hundreds of millions of records). 

 

Ideally, these input parameters should be part of the embedded report URL so we can give them a value from the web app, but this is not the case. I was thinking that since I'm pretty much limited to URL filters, which consist of table/field value. I could create a dummy table and pass a filter to it, and in theory I should be able to capture those filters from the URL, and assign them to my HANA input paremeters from the query advanced editor. 

 

For instance, this is the generated syntax for one of my calculation views, regarding input parameters:

 

let
.......
{
{Cube.ApplyParameter, "IP_TENANT_ID", {{"58"}}},
{Cube.ApplyParameter, "IP_ANHO", {{"2016"}}},
{Cube.ApplyParameter, "IP_MES", {{"06"}}},
{Cube.ApplyParameter, "IP_TIPO_MAT", {{"CERV"}}},
.....
in
#.....

 

Those starting with "IP" are input parameters. All I need is to capture a value from the URL and assign it dynamically to each of them, so, for instance, IP_TENANT_ID will need to use a variable read from the report URL instead of a hardcoded value.

 

I also thought of using Power BI parameters but although these can be changed during runtime via DAX, they cannot be parametrized in the URL either.

 

Any ideas?

 

Thanks a lot in advance.

1 ACCEPTED SOLUTION

HI @Anonymous ,

You can use following api to pass query parameters:

Power BI Embedded Query Parameters API

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

>> All I need is to capture a value from the URL and assign it dynamically to each of them, so, for instance, IP_TENANT_ID will need to use a variable read from the report URL instead of a hardcoded value.

You can try to custom function to parametrize your parameter list as query parameters then you can modify query parameter to achieve dynamic changes.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi v-shex, thanks a lot for your reply.

 

 

 

 

 

 

 

 

HI @Anonymous ,

You can use following api to pass query parameters:

Power BI Embedded Query Parameters API

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Basic question by the way, is it at all possible to use the dashboard generated objects (a measure) in the query advanced editor? 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors