Forum Discussion
nvalPBI
1 year agoRegular Visitor
Can end users Input parameters in a Power App form and pass it to a Power BI query ?
I am working on a report where I need to pass a date field to sql query to pull data for the POwer BI report. Currently date is hard coded and I would like to change it to a variable which accepts...
- Anonymous1 year ago
Hey nvalPBI ,
You’ve done all the hard work already great job.Now to plug that SharePoint date into your SQL query, here’s exactly what you need to do.
- Load your SharePoint list into Power BI
→ Make sure it includes the Term Date the user entered. - Keep just the latest Term Date
→ In Power Query, sort by Created Date (or ID), keep the top 1 row. - Create a parameter in Power BI
- Go to: Manage Parameters → New Parameter
- Name: TermDateParam
- Type: Date
- Set a dummy default value for now (we’ll override it)
- Use that parameter in your SQL query
- In Power Query, edit your SQL like this.
let
TermDate = TermDateParam,
Source = Sql.Database("YourServer", "YourDB",
[Query = "SELECT * FROM YourTable WHERE TermDate = '" & Date.ToText(TermDate, "yyyy-MM-dd") & "'"])
in
Source5. Link the SharePoint date to the parameter
- In Power Query, get the latest Term Date from the SharePoint table
- Use it to replace the parameter’s value
Regards,
Akhil. - Load your SharePoint list into Power BI
Anonymous
1 year agoNot applicable
Hi nvalPBI
To pass a date from Power Apps → Power Automate → Power BI:
- In Power Apps
- Add a Date Picker
- Add a Button to submit
- Connect the button to a Power Automate flow
- Pass the selected date to the flow
- In Power Automate
- Use the Power Apps trigger
- Add a step to insert the date into a SQL table (like UserInputTable)
- Then, add a step to refresh your Power BI dataset
- In Power BI (Power Query)
- Read the date from that SQL table
- Use it in your SQL query like this.
Here’s what your Power BI SQL query might look like.
WHERE OrderDate = (SELECT TOP 1 UserSelectedDate FROM UserInputTable ORDER BY ID DESC)
--------------------------------------------------------------------------------------------------------
If this response helps, consider marking it as “Accept as solution” and giving a “kudos” to assist other community members.
Regards,
Akhil.