Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Power BI: Query parameters in an embed request

Does anyone know of a way in Power BI to set query parameters as described here from an embed request instead of inside desktop? We are attempting to setup a system where we use power bi to power visualizations within our app for customers to view their data. We need to use some sort of parameter system to insure that the query returns the proper customer data for the visualization.

like image 278
Evan Snapp Avatar asked May 10 '17 16:05

Evan Snapp


People also ask

How do you pass parameters in Power BI query?

In Power BI Desktop, select Home > Transform data > Transform data to open the Power Query Editor. Select New Parameters under the Manage Parameters button in the ribbon. Then fill out the following information about the Parameter. Click New again if you have more parameters to add.

What are the limitations of Power BI embedded?

All the PBI data sources are supported. Only two Power BI Workspace Collection data sources are supported. Features such as Q&A, refresh, bookmarks, embedding dashboards & tiles, and custom menus are only supported in the Power BI Embedded solution.

How do you separate parameters in a URL?

URL parameters are made of a key and a value, separated by an equal sign (=). Multiple parameters are each then separated by an ampersand (&).


2 Answers

I suggest you to use Row Level Security for this job. It's pretty simple, let say that in your fact table you have already information about your customer. You can create a role in PBI Desktop that filter the data for the specific user loged-in using the USERNAME() DAX formula. Then when pushing your pbix in the PBI Service your can associate role with user... and you are done.

Hope that helps!

like image 135
Nelson Gomes Matias Avatar answered Oct 21 '22 01:10

Nelson Gomes Matias


You should create new measures in your report and use formula of a role, ex:

IF ( USERPRINCIPALNAME() = "[email protected]", --- some condition --- )

or you can use USERNAME().

like image 37
Nedzad G Avatar answered Oct 21 '22 01:10

Nedzad G