Forum Discussion

mizotac's avatar
mizotac
Regular Visitor
6 years ago
Solved

Filter text values in table A based on partial match from table B

Hello fellow dax-ians ;)   I'm stuck with the following trick. In the below screenshot, I'd like to add a slicer from Table 2 column B (Diagnosis), so that end user will be able to filter paid amou...
  • AlB's avatar
    AlB
    6 years ago

    Hi mizotac 

    One option, if you don't want to split the ICDCodes column in several ones as Matt suggested, is to create a measure for the visual filter:

    1. Place all columns you want to show of Table1 in a table visual. Make sure all are set to "Don't summarize"

    2. Table2[Diagnosis] in a slicer

    3. Create this measure

    ShowMeasure =
    VAR Selected_ =
        SELECTEDVALUE ( Table2[ICD] )
    VAR Current_ =
        SELECTEDVALUE ( Table1[ICDCodesAll] )
    RETURN
        IF ( SEARCH ( Selected_, Current_, 1, 0 ) > 0, 1, 0 )
    

    4. Place the measure in the visual filters and choose to show when result is 1

     

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Cheers  Datanaut

  • AlB's avatar
    AlB
    6 years ago

    mizotac 

    Try this:

    ShowMeasureV2 =
    VAR Selected_ =
        DISTINCT ( Table2[ICD] )
    VAR Current_ =
        SELECTEDVALUE ( Table1[ICDCodesAll] )
    RETURN
        IF (
            SUMX ( Selected_, INT ( SEARCH ( [ICD], Current_, 1, 0 ) > 0 ) ) > 0,
            1,
            0
        )
    

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Cheers  Datanaut