Forum Discussion

Krzysztof_Hyla's avatar
6 years ago
Solved

Calculated column condition with date from slicer

Goal: I want to add a calculated column to my table (if statement) based on the date slicer selection. This will then allow me to filter the table and show only the positions that were active on a ...
  • nandukrishnavs's avatar
    6 years ago

    Krzysztof_Hyla 

     

    Create the below measure.

    Show Row in report? =
    VAR SelectedDate =
        MAX ( 'Calendar'[Date] )
    RETURN
        IF (
            AND (
                SELECTEDVALUE ( 'Positions'[Start] ) <= SelectedDate,
                OR (
                    SELECTEDVALUE ( 'Positions'[End] ) > SelectedDate,
                    ISBLANK ( Positions[End] )
                )
            ),
            1,
            0
        )



    Did I answer your question? Mark my post as a solution!
    Appreciate with a kudos
    🙂