Forum Discussion

stevie_westside's avatar
3 years ago
Solved

Dynamic Date Filter - X Axis

I'm trying to drop a dynamic date filter on the X Axis.  It obviously won't let me do things this way, but as an example this is what I would like it to do, I just don't know how to write the DAX.

Any help would be greatly appreciated.

 

Date Filter - Dynamic by Date = 
    SWITCH('Date Selections'[Selected Timeframe],
    1,Dates,Dates[IsToday] = TRUE,
    2,Dates,Dates[CurrentWeek] = TRUE ,
    3,Dates,Dates[CurrentMonth] = TRUE ,
    4,Dates,Dates[CurrentQuarter] = TRUE ,
    5,Dates,Dates[CurrentYear] = TRUE ,
    6,Dates,Dates[Yesterday] = TRUE ,
    7,Dates,Dates[LastWeek] = TRUE ,
    8,Dates,Dates[LastMonth] = TRUE ,
    9,Dates,Dates[LastQuarter] = TRUE 
        )

 

  • Hi stevie_westside 
    Your expression doesn't work, because it is a reference to 2 different tables and columns.

    If I understand your goal correctly and you just want to create a slicer for a period please refer this tutorial:
    https://www.youtube.com/watch?v=Su1mERlwNdM

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

     

1 Reply

  • Hi stevie_westside 
    Your expression doesn't work, because it is a reference to 2 different tables and columns.

    If I understand your goal correctly and you just want to create a slicer for a period please refer this tutorial:
    https://www.youtube.com/watch?v=Su1mERlwNdM

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