Forum Discussion
query only top n from sql server by a column within specified date range
Hi Anonymous ,
You could write code here:
Reference:
Hi v-xuding-msft , Thanks for the reply.I can write the query as
" select top n * from [table] where date between @startdate and @enddate ordey by [column_name]"
But for this I should be using @startdate and @enddate as query parameters and cannot have this as filter on report.
I want to have date filter on the report so I should not be using query parameters then the quey would be
"select top n * from [table] order by [column_name]"
If I write like this it would have alredy selected top n rows with out considering date range that is set by filter.
any ways and tricks to solve this..?
Thanks!
- v-xuding-msft6 years agoCommunity Support
Hi Anonymous ,
You could reference the similar threads to have a try.
https://community.powerbi.com/t5/Desktop/Power-BI-parameter-for-SQL-Query/m-p/1083092#M501538
https://community.powerbi.com/t5/Desktop/How-to-use-parameters-in-Power-BI/td-p/651552
- Anonymous6 years agoNot applicable
Hi v-xuding-msft ,
I don't want use the query parameters as they won't be available in the power bi online service.
can you suggest any other methods !!
Thanks