Forum Discussion

Edmi8's avatar
Edmi8
New Member
4 years ago
Solved

LookUpValue with filter

Hello everyone

I am trying to create a new column with LookUpValue, but I need it to search under certain condition

I am using this function: Cosecha 20220718 = LOOKUPVALUE('Modelo PY'[Fecha Cosecha],'Modelo PY'[cliente_id], 'Maestro clientes'[cliente_id]) But I need you to filter 'Modelo PY'[Fecha Cosecha]="20220718" When doing the lookupvale of cliente_id Master Clients with the id_client Model PY, I need to only search with those with harvest date "20220718"

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Edmi8 ,

    You can create a calculated column as below in the table 'Maestro clientes':

    Cosecha 20220718 =
    CALCULATE (
        MAX ( 'Modelo PY'[Fecha Cosecha] ),
        FILTER (
            'Modelo PY',
            'Modelo PY'[cliente_id] = 'Maestro clientes'[cliente_id]
                && 'Modelo PY'[Fecha Cosecha] = "20220718"
        )
    )

    Best Regards

2 Replies

  • Edmi8 , You can bring column one table to another like

     

    Table 1 new column, data from Table 2

     

    Maxx(filter(Table2 , Table1[Client] = Table2[Client] && Table1[Month] = Table2[Month]) ), Table2[Value])

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Edmi8 ,

    You can create a calculated column as below in the table 'Maestro clientes':

    Cosecha 20220718 =
    CALCULATE (
        MAX ( 'Modelo PY'[Fecha Cosecha] ),
        FILTER (
            'Modelo PY',
            'Modelo PY'[cliente_id] = 'Maestro clientes'[cliente_id]
                && 'Modelo PY'[Fecha Cosecha] = "20220718"
        )
    )

    Best Regards