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 inwere you able to link the latest Term Date from SharePoint to the parameter in your query? Let me know if you ran into any issues, happy to help.
Regards,
Akhil.