Implement a button using an expression that filters values below a threshold
I have a table with several dimensions (ID, Date, Description, etc.) and several expressions, in particular a measure called %_Defect.
I want to show in the table only the rows with a %_Defect less than 50%. If I want to do this, I use a code like the following (instead of the field name there will be the code to calculate it, obviously):
if(%_Defect < 0.5, %_Defect)
Instead, since I want to set a threshold for each expression, I thought to keep the table free from filter conditions, and to implement a button for each expression, in order to filter every measure by pressing a different button.
I tried to implement a button, with the function Select In the Field, setting the field as "ID" field, and putting as research string the previous code =if(%_Defect < 0.5, % Defect), but it does not work. Where is the mistake?