Filter excel query to show tomorrow and after only.

chrisgarcia78

New Member
Joined
Jun 15, 2024
Messages
31
Office Version
  1. 2021
Platform
  1. Windows
Hi, I have the following row in the excel query advanced editor and it shows the current day only, but I would like to show everything after today, excluding today and previous days.
#"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each Date.IsInCurrentDay([Start])),

Thank you
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Maybe this:
= Table.SelectRows(#"Sorted Rows", each [Start]> DateTime.Date(DateTime.LocalNow()))
 
Upvote 0
Maybe this:
= Table.SelectRows(#"Sorted Rows", each [Start]> DateTime.Date(DateTime.LocalNow()))
Is not working for me, I need to exclude today's date and before. This is the whole code I currently have that shows only todays date

let
Source = Exchange.Contents("INFO@******.COM"),
Calendar1 = Source{[Name="Calendar"]}[Data],
#"Removed Columns" = Table.RemoveColumns(Calendar1,{"Location", "End", "DisplayTo", "DisplayCc", "RequiredAttendees", "OptionalAttendees", "IsAllDayEvent", "LegacyFreeBusyStatus", "IsReminderSet", "ReminderMinutesBeforeStart", "Importance", "HasAttachments", "Attachments", "Attributes", "Body", "Id", "Folder Path"}),
#"Sorted Rows" = Table.Sort(#"Removed Columns",{{"Start", Order.Ascending}}),
#"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each Date.IsInCurrentDay([Start])),
#"Expanded Categories" = Table.ExpandListColumn(#"Filtered Rows", "Categories")
in
#"Expanded Categories"
 
Upvote 0
Can you supply a short 8-15 records of your source document (anonymized data) so that we can test your Mcode and make revisions to achieve the end result required. Also, the term "Is not working for me" is not helpful. What happens when you apply that line of Mcode? What is it doing that is not correct. Help us to help you.
 
Upvote 0
Can you supply a short 8-15 records of your source document (anonymized data) so that we can test your Mcode and make revisions to achieve the end result required. Also, the term "Is not working for me" is not helpful. What happens when you apply that line of Mcode? What is it doing that is not correct. Help us to help you.
Thank you for your time, I'm new with excel and I'm not sure what you mean by 8-15 records but let me explain what I have done.
I have a connection where I get data from Microsoft Exchange Online Calendar and when I added the connection into an excel table and it works fine and I get all the data however I added a filter that shows only the current date of data, so when I go the Advanced Editor I get the code pasted, I just want to modify it to filter the dates from the current date and before and only show the next day and after since I only have the options shown in this picture
 

Attachments

  • Untitled.png
    Untitled.png
    60.4 KB · Views: 5
Upvote 0
Copy 10-15 rows of data from your source data and then use XL2BB to post it here so that we can then run your code and figure out what you need. We cannot manipulate data from a picture and really need to see what your data looks like so we can provide you with a workable solution.
 
Upvote 0
Hi, I added the line you posted and it works but it shows dates from current day and above, I just need this to show the following day and above not including the current day.

= Table.SelectRows(#"Sorted Rows", each [Start]> DateTime.Date(DateTime.LocalNow()))
 
Upvote 0
Hi, I added the line you posted and it works but it shows dates from current day and above, I just need this to show the following day and above not including the current day.

= Table.SelectRows(#"Sorted Rows", each [Start]> DateTime.Date(DateTime.LocalNow()))
Forgot to mention that I added the line you posted but with some modification as follow but again, it shows current day and above.

#"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each [Start] > DateTime.From(DateTime.LocalNow()))
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Query that shows only the "following day and after"
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Forgot to mention that I added the line you posted but with some modification as follow but again, it shows current day and above.

#"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each [Start] > DateTime.From(DateTime.LocalNow()))
I also tried the following adding +1
#"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each [Start] > DateTime.From(DateTime.LocalNow()+1))

but I get the following error message
Expression.Error: We cannot apply operator + to types DateTime and Number.
Details:
Operator=+
Left=7/16/2024 1:31:13 PM
Right=1



 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top