Conditional Between Ref or Enum

Hi, I have a problem solving a formula to achieve the following functionality. In the "Movimientos" table, I have a column called "Especie" (Reference to the "Especies" table).

What I want to achieve is that the user selects a value for the "Especie" column (Ref) if the value of "Tipo de Movimiento" column is equal to "Ingreso".
Now, if "Tipo de Movimiento" column has a value equal to "Egreso", "Especie" should take the value from another table, which I am obtaining with the following formula: LOOKUP([_THISROW].[contrato], "contratos", "id_contrato", "ESPECIE_CONT").

I tried with :
IF([Tipo de Movimiento] = "Ingreso", [Especie], LOOKUP([_THISROW].[contrato], "contratos", "id_contrato", "ESPECIE_CONT"))
But is not working, jeje...


I appreciate the help you can provide. Regards.

Solved Solved
0 3 74
2 ACCEPTED SOLUTIONS

You cannot dynamically change the referenced table because it is statically defined in the table column definition. So you need to create two different columns and control "show_if" based on "Tipo de Movimiento"

View solution in original post

I am back with this one. I tried what you suggest, but it would be messy to generate another information by doing it that way. May be i explained clearly what i was trying to achive. The thing is thta i figured it out, and it goes like this:
if([Tipo de Movimiento] = "egreso", any(SELECT(
Contratos[Especie_Cont],
([Id_Contrato] = [_THISROW].[Contrato])

JPAN_0-1712238507472.png

 

View solution in original post

3 REPLIES 3

You cannot dynamically change the referenced table because it is statically defined in the table column definition. So you need to create two different columns and control "show_if" based on "Tipo de Movimiento"

You are right for sure Teesee....
Something clouded my reasoning, haha.... It was so simple...
Thank you very much!

I am back with this one. I tried what you suggest, but it would be messy to generate another information by doing it that way. May be i explained clearly what i was trying to achive. The thing is thta i figured it out, and it goes like this:
if([Tipo de Movimiento] = "egreso", any(SELECT(
Contratos[Especie_Cont],
([Id_Contrato] = [_THISROW].[Contrato])

JPAN_0-1712238507472.png

 

Top Labels in this Space