How to use a query with parameterin Power BI?

66 views Asked by At

I have a query that get the number of days from the user and display the result, like the following:

declare number_of_days = 10
select *
from myTable
where getdate() - opendate > number_of_days

I use direct query mode in Power BI and want to get the value for the parameter from the user and then show the result to them.

How can I use a query with parameter in Power BI direct query mode?

1

There are 1 answers

0
David Browne - Microsoft On

Use Dynamic M query parameters to re-generate a SQL query which you use with a Native Query