Forum Discussion

Kellef's avatar
Kellef
Icon for Helper I rankHelper I
2 years ago

Dynamic dateslicer with all days marked until today

Hello,

I have created a hierarchy of year, month and day.

I'm trying to get the date slicer set as the latest date dynamically today()).

But I'm also trying to make the date slicer select all days up to today, today(). Is this possible? I want to look at all the data up to today, and not per day. So that all days are checked in until today.

 

What i have created so far: 

Latest period = date(year(TODAY () ),MONTH ( TODAY ()),day(TODAY ())) (a column created in the Datedimension, and 
Period = IF (
 
        YEAR ( 'DimDate'[Date] ) = YEAR ('DimDate'[Latest period] )
 
        && MONTH ('DimDate'[Date]) = MONTH ( 'DimDate'[Latest period] ),'DimDate'[month],'DimDate'[month])
i use this in my dateslicer to enter the report on the latest year and month at the moment (and will put in day as soon i get an a good tip for this problem 🙂 ).

/Patrik


6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Kellef 

    You can refer to the following example.

    Sample data 

    1.Create a measure

    Measure = IF(EOMONTH(MAX('Table'[Date]),0)=EOMONTH(TODAY(),0),1,0)

    2.Put the date hierarchy to the slicer,and put the meaure to the slicer visual filter.

     

     

    Output

     

    Best Regards!

    Yolo Zhu

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

  • Thank you, this is already what i have done, second part is that i want. example: today is 2024-03-13 , i want 2024 to be checked, the month to checked and all days until the 13 th to checked. is that possible?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Kellef 

      You just need to change the measure to the following.

      Measure = IF(YEAR(MAX('Table'[Date]))=YEAR(TODAY())&&MAX('Table'[Date])<=TODAY(),1,0)

      Output

       

      Best Regards!

      Yolo Zhu

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

       

      • Kellef's avatar
        Kellef
        Icon for Helper I rankHelper I

        I want the dateslicer to look like this, ackumulated until today.
        i tried youre way, but maby im missing something? 

        best regards,
        Patrik