Forum Discussion
Limit import based on date
- 8 years ago
select filter on your date column and then choose parameter as show below in below circle, and select your parameter.
This is how I would do it.
Click on your EDIT QUERIES tab
Select the filed you want to limit to 3 years
Click on the drop down arrow to the right of that field
Choose Date Filters
Choose In the Previous
When Filter Rows comes up, have it read is in the previous 2 years then OR
is in year This Year
See screenshot
Thanks a lot kattlees !! It works .
I can see after doing that , I got below line in Qry .
#"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each Date.IsInPreviousNYears([ResultTime], 2) or Date.IsInCurrentYear([ResultTime]))
One question here -- It's not the case that all the Table's data has been fetched into my System (as I did import) and from there this filter has been applied ? Or this filter applied while fetching the data itself from SQL DB ?
Thanks in Advance !
- kattlees8 years agoPost Patron
I believe all the data is imported in and then filtered by the date you chose. You can change the date and get more data if you want.
If you don't want it to import at all, I would use parry2k solution as he is a power bi super user! He has helped me on numerous occassions.
- sanjoyleo8 years agoHelper I
To @parry2k
Can you please give your valuable feedback here ? I was thinking If my Transaction table has 10M of data , then pulling all records and then filter in Desktop is a good option or not as I am using Import as connection.
Thanks
Sanjoy
- parry2k8 years agoSuper User
sanjoyleo What is your data soure? Sql? Better to restrict at the source if you can. May be create a view at source, and pre filter the data for the period you need and then use that view in PowerbI.
Let me know what is your data source then we can work from there.
Thanks,
P