Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

query only top n from sql server by a column within specified date range

I have a large set of data that exceeds power bi row limits and am getting operation timeout. I want to query only top n rows from sql server based on one column and also want to have date filter on it.

 

"select top n * from table where date between @startdate and @enddate order by column_name"

 

I know I can do this by using query parameters but I want to have date filter on the report. So, let me make it clear

 

1) I have a date filter on report

2) I want to direct query only top n rows from sql server by a column within the specified date range set on filter.

 

The top n filter on visual queries all the rows from sql server and applies top n filter at last but I want to fetch only top n rows from sql server so that it would not give timeout and would be fast as well.

Thanks in advance! 

7 Replies