Forum Discussion

Nibz's avatar
Nibz
Icon for Helper I rankHelper I
8 years ago

Slicer last day

Hello,

 

I have a timeline slicer based on the last day, but users can select 7 days before

I would like each day the slicer is in the last day.

 

When a user enter in the report, it is on the last day, but he can change on an onther day if we wants

 

How can I handle that ?

 

 

11 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Nibz

    Assume that you have a calendar table, you can create a column using the DAX below, then create a slicer using this column, and select “Yesterday” in the slicer.

    Day = IF( DateTable[Date] = TODAY() - 1, "Yesterday", DateTable[Date])


    Another option is to create a measure calculating the value of last day, and put the measure into a card.  After that, click on the Timeline slicer, select “Edit interactions”, choose “None” in the card visual. This way, when users select days in the timeline slicer, the card visual will not be filtered.

    Yesterday Measure =CALCULATE (    SUM ( yourTable[Column] ),    FILTER ( ALL ( yourTable), RELATED ( DateTable[Day] ) = "yesterday" )

     

    Regards,
    Lydia

      • Anonymous's avatar
        Anonymous
        Not applicable

        Nibz,

        Please use the DAX below instead, then create a slicer using this column and set its value to 1.

        Yesterday= IF( Reservation[Start] = TODAY() - 1, 1, 0)


        Regards,
        Lydia