Don't show button if referenced information is true

I have two tables. One called "Vistorias", another called "Taxi Drivers".

In the "Taxi Drivers" table there is a virtual column called "PENDENCIAS", whose value varies between "OK" or "".

The "Vistorias" table makes reference to the "Taxi drivers" table. It has a column called "TP Nยบ", which also exists in the "Taxi Drivers" table, to list all the data in the "Vistorias" table related to each TP Nยบ in the "Taxi Drivers" table.

I'm trying to display the "Add" action for the "Vistorias" table, only if the TP Nยบ related to the "Taxistas" table has the "PENDENCIAS" column with the value "OK".

I tried the following formula, without success:

ANY(SELECT(Taxi Drivers[PENDENCIAS], ([_THISROW].[TP Nยบ] = [TP Nยบ])))="OK"
Solved Solved
0 1 77
1 ACCEPTED SOLUTION

If you are only ever expecting there to be a single row in the "Taxi Drivers" table that matches the [TP No] column, the expression is perfectly fine.  If there could be more than 1 row with the same [TP No] then you should know that the ANY() function will simply grab the first row which may not be the one you want.  If this is the case then you will want to add additional criteria to the SELECT() function to further filter the rows.

If there is only a single row and result is not as you expect, I recommend looking at the data closely.  Either:

  • the "PENDENCIAS" doesn't have the value you are expecting (e.g. "Okay" instead of just "Ok?? or some other value all together) 
  • [TP No] is not the way to match the rows
  • There isn't a row for the value you are trying to match

If the above doesn't help and you need more assistance, please show us examples of your data you believe should be matching and the view results.

 

I hope this helps!

View solution in original post

1 REPLY 1

If you are only ever expecting there to be a single row in the "Taxi Drivers" table that matches the [TP No] column, the expression is perfectly fine.  If there could be more than 1 row with the same [TP No] then you should know that the ANY() function will simply grab the first row which may not be the one you want.  If this is the case then you will want to add additional criteria to the SELECT() function to further filter the rows.

If there is only a single row and result is not as you expect, I recommend looking at the data closely.  Either:

  • the "PENDENCIAS" doesn't have the value you are expecting (e.g. "Okay" instead of just "Ok?? or some other value all together) 
  • [TP No] is not the way to match the rows
  • There isn't a row for the value you are trying to match

If the above doesn't help and you need more assistance, please show us examples of your data you believe should be matching and the view results.

 

I hope this helps!

Top Labels in this Space