IF NO EXACT MATCH REPLACE WITH THIS VALUE

I have a table called TARIFARIO MATRIZ where I have service costs with columns [ESTACION], [DETALLES DE SERVICIO] and [TARIFA].
and I have another table called SERVICIOS with column [TARIFA] and in this column [TARIFA] I have the following expression to compare and bring the matching rate.

ANY( SELECT(TARIFARIO MATRIZ[TARIFA], AND(
[ESTACION]=[_THISROW].[ESTACION],
[DETALLE DEL SERVICIO] = [_ThisRow].[SERVICIO]
)))

so far everything works fine.

but i would like that if in case when comparing the table SERVICIOS [ESTACION] with the table TARIFARIO MATRIZ[ESTACION] the value of these do not match, then in the table SERVICIOS [ESTACION] replace with the value "TODOS" because in the table TARIFARIO MATRIZ i have list of services where the column [ESTACION] contains cities also a value "TODOS" and when there is a coincidence between values "TODOS" in both tables, it will bring me the result that is in TARIFARIO MATRIZ [TARIFA].

EXPRESSION IN TABLE SERVICIOS[TARIFA]

wsaico_1-1660827338444.png

THIS IS THE TARIFARIO MATRIZ TABLE

 

wsaico_3-1660828025935.png

 

could you help me to solve this case please? thank you very much for your help.

 

 

0 1 64
1 REPLY 1

This needs more information to understand what your goal is.

For instance, you state "but i would like that if in case when comparing the table SERVICIOS [ESTACION] with the table TARIFARIO MATRIZ[ESTACION] the value of these do not match".  What value are you referring to? 

If you mean the value of [ESTACION] when comparing a row in the SERVICIOS to a row in the TARIFARIO MATRIZ tables, then how (what criteria) does one use to identify the rows in the two tables that need to be compared?  We can't use your sample expression as is because it is already finding matches - it doesn't tell us rows where certain columns DON'T match.

It might help to explain what the relationship between the SERVICIOS and TARIFARIO MATRIZ tables is?

Top Labels in this Space