Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

filter dates on multiple tables without relationship

Hello,    I am having an issue with a model. I have five tables that need to be linked using an ID, which works fine. But in addition, I would like to have a general Date filter that filters all th...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    According to my understanding, you want to use Date for Slicer to filter all other tables when there are relationships among the other tables but no between Date table and the others, right?

    Please try to use the following formula and then apply it(set as "is 1") to all visuals:

    Measure =
    VAR _min =
        MIN ( 'Date'[Date] )
    VAR _max =
        MAX ( 'Date'[Date] )
    VAR _idTab1 =
        SUMMARIZE (
            FILTER (
                ALL ( 'Table1' ),
                MAX ( 'Table1'[Date] ) >= _min
                    && MAX ( 'Table1'[Date] ) <= _max
            ),
            [ID]
        )
    RETURN
        IF ( MAX ( 'Fact'[ID] ) IN _idTab1, 1, 0 )

     

    The final output is shown below:

    Here is the pbix file.

     

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