Can I programatically pass a parameter value to a PowerBI report? - powerbi

I have an embedded PowerBI report that needs to execute a query with a parameter that changes depending on which client opens a report. I need to programatically pass the value of a parameter (that cannot be prepopulated inside a filter) so that I can then use this value to execute the SQL query.
Also this parameter should not be visible/modifiable to the reader of the report because they would be able to change the value and see data they were not supposed to see.
I tried passing a value programatically to a filter but the filter needs to contain the value in order to set the value being passed.

You can do this with a Paginated Report using a Hidden Parameter, but not a Power BI Interactive Report. See In SSRS, how does an "Internal" parameter differ from a "hidden" parameter?

Related

How do you create a parameter list drop down in Power BI?

I have always been able to create drop-down list parameters within SSRS that allow the user to dynamically filter their reports based on one or more values selected from the drop-down list box of multiple values.
Translating now over to Power BI I cannot find any documentation to achieve the same functionality.
I've found a method of turning the slicer into a drop down list box. But it only allows for the selection of 1 value at a time. So it essentially seems to me to be more of a drop-down list of radio buttons.
In SSRS I could create a stored procedure that accepted a value and returned a record set filtered on a specific value(s).
I can see how to do this with Power BI as well but the method I've seen demonstrated, forces the user to select a value before the report is loaded and subsequently loads a pre-rendered report template. Which isn't the same.
So how does one go about creating a report that implements a true drop-down list box allowing for selection of 1 or more values to dynamically generate the result in the report?
Reference links are welcome if a simple answer isn't possible.
This is an out-of-the-box feature in PowerBI
Create a slicer visual and, as you've already discovered, set it to Dropdown type using the upside down carrot icon on the slicer header. The dropdown list is multi-select by default. Hold down [ctrl] while making the multiple selections. However, you can control Multi-Select behavior under the 'paintbrush.' When the visual is active, click the paintbrush icon under visualizations, expand 'Selection Controls' and you will see several options to manage your slicer's behaviors.
Additionally, you may want to explore the new filter experience, which is still in beta. https://learn.microsoft.com/en-us/power-bi/power-bi-report-filter-preview
Otherwise, The behavior in SSRS where the report loads from data sources using parameters chosen by users either as parameters in stored procedures or incorporated into dynamic SQL is not replicated in PowerBI. It's true that there are parameters that can be incorporated in that way with the data set refresh - but these are controlled on the data set, not the report, and are not convenient (or appropriate, really) for report viewers to manipulate.

How to transfer the value from the filter to Power Query and insert it into the query?

I have a report that displays data for a certain period. There are two parameters in the report: the start date and the end date. Data is displayed for the specified period. I want to dynamically load data using a filter in the report, rather than changing the parameters of the query. How can this be implemented?
You can set up a Direct Query where it pulls in the data only when it needs it.
Note that you can have a composite model where some tables are Direct Query and others are Import.

Power BI change data source parameter

Is it possible and how change data source parameter value with slicer or check box click in power bi without manual edit and then refresh data.
No, it isn't possible. However, you can make a report which connects and reads all the data sources, and use a What-if parameter with slicer to calculate result based on one of the data sources only (depending on the what-if parameter's value).

Oracle Apex 5.1.1 Interactive Report with PL/SQL

How do I can to create an interactive report with PL/SQL in Apex 5.1.1?
It's important that work in Apex 5.1.1
The IR have a PL/SQL with Dynamic Parameters that I want change the query before submit with values of parameters that user can select
Aha, that would be a function (i.e. PL/SQL program unit) that returns query which is used as a source for the interactive report? If so, let it accept parameters which will be used to compose the SELECT statement. Depending on what you pass, you'll get appropriate SELECT.
I'd suggest you to move the function into the database (i.e. so that it is a stored function). Doing so, you'll be able to test it in a simple manner than if it was in Apex.

Power BI - how to get reports on Power BI web on the basis of parameters

I am new to Power BI, doing some work.
I have millions of records in SQL Server database, what i want to achieve is..
whenever my colleagues open the report on Power BI, it must ask for the date parameter.
Once the date is submitted, then it must go to the SQL Server and fetch the data and then it must display the report.
Is it possible?
If it is, could some one please show me how to achieve it?
If you define a parameter in your report and use it for filtering data, when you load the report, the data matching the filter will be loaded. You can provide a default value, that you know will return no data (e.g. date in the future, if you are showing the data on or after some date).
You can declare a parameter (in your case of date data type) and use it to filter the data. To declare it, open your report in Power BI Desktop, go to Power Query Editor (by clicking on Edit Queries button in the ribbon) and define a new parameter in Manage Parameters dialog:
Make sure the data type of the parameter matches the type of your data, i.e. if your data has time, define Date/Time parameter. If your data is Date, define Date data type parameter.
Then go to your query, which you want to filter and click on the button in the header of the column you which to filter. In Date/Time filters menu choose how to filter the data, e.g. to fetch the data that is on or after some date:
Then you can close Power Query Editor and return to the report. You can change the parameter's value from the drop down under Edit Queries - Edit Parameters.
If you want to avoid loading data for the default value of the parameter, you can save this report as template (File -> Export -> Power BI template), and then send this template to your colleagues. When they open it, they will be prompted to enter values for the defined parameters, and only after that, the report will connect to the data source and fetch the matching data. This means that first, you didn't use Power BI Online, but shared the report as a file, and second your colleagues has access to the data source to be able to load the data.
If you must publish the report to Power BI Online, then you can use completely different technique - instead of defining a parameter, pass the filter in the report's URL. When the report is loaded normally (e.g. you go to the workspace and open the report), it will show all the data (it will not be filtered). However, you can prepare a special URL for your colleagues, by appending ?filter=MyTable/DateColumn ge 2019-02-04 to the report's URL that you see in the browser's address bar. Replace MyTable with the name of the table you want to filter (e.g. SalesData) and DateColumn with the name of the field on which you want to filter (e.g. SalesDate). If there are spaces in these names, you must replace them with _0x0020_, but if possible, just avoid them. After that the filter defines an operator for filtering, e.g. ge means greater than or equals. And at the end is the value (the date in your case).
You can make a web page, where the user can select a date, and this page will generate the appropriate URL for your report. Or you can make another report, where the URL is constructed as a computed column or a measure based on some conditions (e.g. selecting a date from a slicer) and the user can click on the hyperlink, which will load the actual report, but filtered.