Forum Discussion

jacobkushh's avatar
jacobkushh
New Member
1 year ago
Solved

Compare Variable Stores

I'm new to PBI and struggling to understand why this if statement isn't working. 

I want to check whether the selected filter value is present in another table (linked via a separate key). 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi  jacobkushh , hello Arul, thanks for your concern about this case.

     

    Please check if the following measure meet your requirements:

    IsValueInTableB = 
    IF(
        CONTAINS(
            TableB,
            TableB[Value], 
            SELECTEDVALUE(TableA[Selected Value])
        ),
        "Exists",
        "Not Exists"
    )

     

     

    Result for your reference:

    If this option is not feasible, please provide more detailed information in your response, however without any sensitive content.

     

    Best regards,

    Joyce

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  jacobkushh , hello Arul, thanks for your concern about this case.

     

    Please check if the following measure meet your requirements:

    IsValueInTableB = 
    IF(
        CONTAINS(
            TableB,
            TableB[Value], 
            SELECTEDVALUE(TableA[Selected Value])
        ),
        "Exists",
        "Not Exists"
    )

     

     

    Result for your reference:

    If this option is not feasible, please provide more detailed information in your response, however without any sensitive content.

     

    Best regards,

    Joyce

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.