I have an aggregate that I want the user to be able to filter by minimum and maximum values of a variable tied to an input field. If the field is empty, no filtering should happen. If it has a number, then filter by showing only records where a field has at least the value in the variable. I've tried the following, but even when the input field is empty, and therefore the variable is empty, no records get returned.
(minBalance <> "")
and (minBalance > 0)
and (TextToInteger(Table.Balance) > minBalance)
Adding this filter to the aggregate removes all records from the search. Removing it successfully shows the records expected. How can I use a field to filter numeric data based on minimum (and, eventually, maximum) values entered by the user?
If the input field is empty, the expression needs to return true. So you need to invert the condition and use or
. You may also need to convert the input to integer, just like Table.Balance
.
(minBalance = "") or (TextToInteger(Table.Balance) > minBalance)