Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to use filter formula

hello.

how can I filter a value from a column that contains letters with tempering with the other columns e.g

to filter all ref_id that starts with CRII TB card_ as shown in the image above. thanks.

  • Anonymous's avatar
    Anonymous
    3 years ago

    i want to filter in a measure, and i tried the containstring function but it didn't return anything. can you show me the full function PLEASE?

     

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

    Please try below steps:

    1. below is my test table

    Table:

    2. create a mesure with below dax formual

    Measure =
    VAR _refslip =
        SELECTEDVALUE ( 'Table'[ref_slip] )
    VAR _val =
        IF ( CONTAINSSTRING ( _refslip, "CRII TB card_" ), "True" )
    RETURN
        _val
    

    3. add a table visual with field and measure

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please try below steps:

    1. below is my test table

    Table:

    2. create a mesure with below dax formual

    Measure =
    VAR _refslip =
        SELECTEDVALUE ( 'Table'[ref_slip] )
    VAR _val =
        IF ( CONTAINSSTRING ( _refslip, "CRII TB card_" ), "True" )
    RETURN
        _val
    

    3. add a table visual with field and measure

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    i want to filter in a measure, and i tried the containstring function but it didn't return anything. can you show me the full function PLEASE?