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
Just checking, Were you able to try out any of the suggestions shared earlier? If your issue is resolved, marking the accepted solution would be a big help to others who might be facing the same scenario.
If you went in a different direction or still need support, feel free to drop a quick update, we’re happy to keep helping.
Regards,
Akhil.