Forum Discussion

JPurser77's avatar
JPurser77
New Member
1 year ago
Solved

Relative Date Slicer

Looking for a way to use a relative date slicer for 'This Year' that will only select through the current date, and not the entire year.

For example when I set the relative date slicer in my dashboard to 'This Year'  the date range selected is 1/1/2024 - 12/31/2024.   I would need this date range to be 1/1/2024 - todays date.  

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thank you Idrissshatila , Daniel29195 and Ashish_Mathur 

    Hi, JPurser77 

    Based on your description, I tested this type of slicer:
    This type of slicer is not affected by your date column, it's built-in:

    I use a date column with only a few dates:

    You can see that this feature is not affected by your date column. Because it's by design. You can use the following alternative solution:

    Set to last 256 days:

    Or you can use the between slicer:

    In this case, create a calculated column using the following DAX expression:

    Column = IF('Table'[Date]<=TODAY()&&'Table'[Date].[Date]>=DATE(2024,1,1),1,0)

    Put this calculated column on the filter panel of the between slicer:

    This will dynamically display the date range from the beginning of the year (2024--1) to today.  I've provided the PBIX file used this time below.

     

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

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

4 Replies

  • Daniel29195's avatar
    Daniel29195
    Community Champion

    JPurser77 

     

    create a calculated column in the dimdate, 
    checking if today() >= dimdate[date] , 0 , 1 ) 

     

     

    then set this in the filter pane on page or all pages level --> set it  is equal to 1 .

     

    let me know if this helps 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you Idrissshatila , Daniel29195 and Ashish_Mathur 

    Hi, JPurser77 

    Based on your description, I tested this type of slicer:
    This type of slicer is not affected by your date column, it's built-in:

    I use a date column with only a few dates:

    You can see that this feature is not affected by your date column. Because it's by design. You can use the following alternative solution:

    Set to last 256 days:

    Or you can use the between slicer:

    In this case, create a calculated column using the following DAX expression:

    Column = IF('Table'[Date]<=TODAY()&&'Table'[Date].[Date]>=DATE(2024,1,1),1,0)

    Put this calculated column on the filter panel of the between slicer:

    This will dynamically display the date range from the beginning of the year (2024--1) to today.  I've provided the PBIX file used this time below.

     

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

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