Forum Discussion
Filter query by date column
- 8 years ago
This drives me nuts! I agree, I expect "is in the previous" to include the current month too.
However you can do what you want. First of all, on the dropdown menu at the top of the column, choose Date Filters/Month/This Month. This will give you a filter that filters out all the data from the current month. Next, go to the Applied Steps pane and click on the gear-shaped icon next to the newly-created Filtered Rows step. This opens up a dialog that allows you to edit the step. You'll see a condition that says "is in month" equals "this month"; underneath it select the Or radio button and then add a new condition that is "is in previous 5 months". It should look like this:
Click OK and you should be good.
HTH,
Chris
- 8 years ago
It's worth pointing out that this filter will return any dates that are in the current month but after today's date - which may not be what you want. I've written up this problem and a full solution in a blog post: https://blog.crossjoin.co.uk/2018/01/08/in-the-previous-date-filters-in-power-bi-gettransform-power-query/
Chris
This drives me nuts! I agree, I expect "is in the previous" to include the current month too.
However you can do what you want. First of all, on the dropdown menu at the top of the column, choose Date Filters/Month/This Month. This will give you a filter that filters out all the data from the current month. Next, go to the Applied Steps pane and click on the gear-shaped icon next to the newly-created Filtered Rows step. This opens up a dialog that allows you to edit the step. You'll see a condition that says "is in month" equals "this month"; underneath it select the Or radio button and then add a new condition that is "is in previous 5 months". It should look like this:
Click OK and you should be good.
HTH,
Chris
Chris,
I need to filter a timestamp column to show only last 7 day's data. I used "in the previous" 7 day filter, but it didn't do any filter. The timestamp column data type is date/time and it is in this format: 7/27/2018 12:00:55 AM. I don't know why it didn't filter anything. Do you think it may be related to the special data format? What do you suggest to resolve this problem?
Thanks in advance.
Pei