Forum Discussion

spandy34's avatar
spandy34
Responsive Resident
4 years ago
Solved

IF Lookup Column

Hi

I want to create a column where in the column named Test it returns the Net Premium Value if the Policy Code includes the letters LEX.  The format of the data in the Policy Code could be M05LEX, M11LEX, M10LEX  - the DAX below isnt working. any ideas ?

 

Test = If(INS_Premium[PolicyCode]="LEX",'INS_Premium'[NetPremium])

 

 

amitchandak goncalogeraldes tamerj1 

  • Hi spandy34 
    Hope you're doing fine.

    Please try

    Test =
    IF (
        CONTAINSSTRING ( INS_Premium[PolicyCode], "LEX" ),
        'INS_Premium'[NetPremium]
    )

2 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi spandy34 
    Hope you're doing fine.

    Please try

    Test =
    IF (
        CONTAINSSTRING ( INS_Premium[PolicyCode], "LEX" ),
        'INS_Premium'[NetPremium]
    )