Forum Discussion

bridgwan's avatar
bridgwan
Frequent Visitor
5 years ago
Solved

Advanced Date Filtering for Active rows at any date during the period

I need a method to dynamically filter two columns (Start Date and End Date) to include active rows for one or more dates in a user defined range. The four scenarios for rows to be included are: 1. R...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi bridgwan ,

     

    Sorry for my misunderstanding, you may try this measure:

    Measure =
    VAR _sele =
        YEAR ( MAX ( 'Calendar'[Date] ) ) * 100
            + MONTH ( MAX ( 'Calendar'[Date] ) )
    RETURN
        IF (
            _sele
                >= YEAR ( MAX ( 'Table'[Start Date] ) ) * 100
                    + MONTH ( MAX ( 'Table'[Start Date] ) )
                || _sele
                    <= YEAR ( MAX ( 'Table'[End Date] ) ) * 100
                        + MONTH ( MAX ( 'Table'[End Date] ) ),
            1
        )
    

    Then apply the measure to filter pane(set as "is 1"), the final output is shown below:

    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.