Forum Discussion

Spekko's avatar
Spekko
Icon for Helper I rankHelper I
5 years ago
Solved

Filter data based on date-field in other table

After lurking frequently in this community, time for my first post.   Is it posible to filter results in a visual based on the contents of another table? In this case: i've got Marketing Qualified...
  • Icey's avatar
    5 years ago

    Hi Spekko ,

     

    Try this:

     

    1. Create relationship between the two tables.

     

    2. Create measures:

    • Show all related information after the MQLDate.
    Measure 1 = IF ( MIN ( 'Lead'[Lead Create Date] ) > SELECTEDVALUE ( 'MQL'[MQLDate] ), 1 )
    •  Show only the first lead after the MQLDate.
    Measure 2 = 
    VAR MinLeadCreateDate =
        CALCULATE (
            MIN ( 'Lead'[Lead Create Date] ),
            FILTER (
                ALLSELECTED ( 'Lead' ),
                'Lead'[MQL Id] = SELECTEDVALUE ( 'MQL'[MQL ID] )
                    && 'Lead'[Lead Create Date] > SELECTEDVALUE ( MQL[MQLDate] )
            )
        )
    RETURN
        IF (
            SELECTEDVALUE ( MQL[MQL ID] ) = BLANK (),
            1,
            IF ( MIN ( 'Lead'[Lead Create Date] ) = MinLeadCreateDate, 1 )
        )

     

    3. Put measures into "Filters on this visual" field of needed visuals and set "is 1", then test.

     

    BTW, .pbix file attached.

     

     

    Best Regards,

    Icey

     

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