Power Query - Filter to Numbers equal to or greater than

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I have a table that has a field with numbers in it.

That field is a custom field that subtracts todays date from the date in another field
= Table.AddColumn(#"Sorted Rows", "Validity", each Duration.Days(Date.From(DateTime.LocalNow()) - Date.From([EndDate]))*-1)

I want the User to be able to enter a number and the table filters the Validity column to show only numbers equal to or greater than the number the user enters.

I have a UserForm where the User enters that number and it is stored in a table on a tab named Validity. On that tab I have a table named Validity Days. That table I converted to a List called Selected_Validity_Days

I assume its something like this except I don't know how to do the greater than part. I do want it show all if the user does not enter a number

List.Contains(Selected_Validity_Days,[Validity]) or List.NonNullCount(Selected_Validity_Days)=0)

I appreciate the help and training!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Something like

Table.SelectRows(YourTableName, let isNull = (CheckNum = null) in each isNull or [Validity]>=CheckNum)

Where CheckNum is the number the user entered (or null), and YourTableName is the table you want to filter
 
Upvote 0
Solution

Forum statistics

Threads
1,223,648
Messages
6,173,561
Members
452,520
Latest member
Pingaware

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