Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all,
I have a requirement to migrate a Tableau report to Power BI. In tableau, there is a text parameter that takes a string from end user and pass it on to a stored procedure that runs and brings the results in the report. I want to create something similar in Power BI. Can anyone please advise me how can I create a parameter that takes an input string from end user and pass it to a stored procedure? As pe my research, there is a What if parameter that can be shown in the PBI report but the problem is that it only takes numeric values. I want to use a parameter that takes a string.
Any solutions or workarounds are welcomed.
Hi @rizwanmalik, Do you tried changing the type of Parameter, Make sure it is text type then it will accept strings. I have shared few steps below as well via which you can create the parameter.
Create a Text Parameter:
Create a Parameter Table:
Use the Parameter in Power Query:
Bind Parameter to Report Elements:
Publish and Configure:
you can achieve this in Power BI Desktop by creating Parameters in the Power Query Editor. You can open the Power Query editor by clicking on 'Transform Data' in PBI Desktop.
Here is a link to a youtube video explaining the method: https://youtu.be/9rRFh6UQfmY?si=uwp_O1Q4ErIlW2K1
You can integrate Power Apps with Power BI to create a text input field. The input from Power Apps can then be used to call a stored procedure. Here’s a high-level approach:
Although Power BI doesn’t natively support text input parameters in the report view, you can create a query parameter in Power Query:
While default slicers don’t support text input, there are custom visuals available in the Power BI marketplace that allow for text input. One such visual is the “Text Filter”:
If your data source supports Direct Query mode, you can pass the parameter directly to the SQL query:
Check out the Tutorial here if you need some more guidance !!
Setup Dynamic Parameters to Filter data in your PowerBI Report | MiTutorials (youtube.com)
Hi @rizwanmalik -In Power BI, you can create a parameter that takes a string input from the end user and pass it to a stored procedure using a combination of Power Query and dynamic M code
Go to Home > Transform data to open the Power Query Editor.
In the Power Query Editor, go to Manage Parameters > New Parameter.
Name your parameter (e.g., UserInput), set the data type to Text, and set the default value if desired.
Click OK.
Ref:
Parameters - Power Query | Microsoft Learn
Power Query and Stored Procedures with Parameters | Reeves Smith's SQL & BI Blog (wordpress.com)
Hope it helps
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
109 | |
99 | |
96 | |
38 | |
36 |
User | Count |
---|---|
151 | |
125 | |
75 | |
74 | |
53 |