Forum Discussion

mattrixdesign2's avatar
3 years ago

Filtering by Multiple Columns (not AND, but OR)

Hi

 

Really not sure how to start with this I am going around in circles.

 

I have tracking table like this...

 

TRACKING TABLE:

PROJECT_NUMTrack by Account #Track by Part #Track by order #
abc123456374728nullnull
abc123457nullUH-MADEUP-3null
abc123458nullUH-MADEUP-2000null
abc123459nullnull34A09024
abc123460nullnull34A09125
abc123461276984nullnull
abc123462nullnull20B07098
abc123463nullnull54YB0D63
abc123464nullnull54YB0HGJ
abc123465nullnull1X5B15XY
abc123466nullnull1X5B165X
abc123467nullnull1X5B15QW
abc123468166995nullnull
abc123469155542nullnull

 

INVOICE TABLE:

Track by Account #Track by Part #Track by order #
374728Part 134A09999
145525UH-MADEUP-356554645
145525UH-MADEUP-200065666626
365662Part 134A09024
234141Part ABV34A09125
276984Part ABV53255252
466622Part ABV20B07098
754775Part fdgfds54YB0D63
524325Other Park54YB0HGJ
475473XYZ Part1X5B15XY
475473AAAA-Part1X5B165X
475473AAAA-Part1X5B15QW
166995XXXXX-PN32553256
155542XXXXX-PN43643243

 

I want to be able to use the TRACKING TABLE to filter the rows of the invoice table, where ever there is a match on ANY column.

 

Seems obvious but I am lost with it, not even sure what to search for in terms of help. 

 

Any suggestion welcome.

1 Reply

  • Hi there,

    create inactive relationships like this:

     

    with a measure like this:

     

     

    VAR _TblAccount =
        UNION (
            CALCULATETABLE (
                'Invoice Table',
                USERELATIONSHIP ( 'Invoice Table'[Track by Account #], Tracking[Track by Account #] ),
                NOT ( ISBLANK ( Tracking[Track by Account #] ) )
            ),
            CALCULATETABLE (
                'Invoice Table',
                USERELATIONSHIP ( 'Invoice Table'[Track by order #], Tracking[Track by order #] ),
                NOT ( ISBLANK ( Tracking[Track by order #] ) )
            ),
            CALCULATETABLE (
                'Invoice Table',
                USERELATIONSHIP ( 'Invoice Table'[Track by Part #], Tracking[Track by Part #] ),
                NOT ( ISBLANK ( Tracking[Track by part #] ) )
            )
        )
    RETURN
        COUNTX ( _TblAccount, MAX ( Tracking[PROJECT_NUM] ) )

     

     

    you can use this measure then to filter in visuals where the IsTracked is not blank