Power Query - Filter to Numbers equal to or greater than

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,342
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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,215,688
Messages
6,126,209
Members
449,299
Latest member
KatieTrev

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