Forum Discussion

Shamatix's avatar
Shamatix
Post Partisan
8 years ago
Solved

Default date values in slicer

Hey fellow users of Power Bi,

 

I have a slicer with a from and to date  as seen on the below picture.

I want this slicer to ALWAYS start with the last years values, for example today its the 14-03-2018 so I want it to default to 14-03-2017 to 14-03-2018 HOWEVER I want the user to still be able to drag the slicer more to the "left" to expand it to years before 2017 as well.

I just want it to START with the latest year chosen by default, how is this possible?

  • Hi Shamatix,

     

    Please, try this solution:

     

     Here is the sample code

     

    Left slicer is a switch between one year operations "1" (button slicer for control, from now-365 to now) and "All" dates.
    "0" - is another dates (not last year) of need.

     

    Best regs!

1 Reply

  • McCow's avatar
    McCow
    Resolver III

    Hi Shamatix,

     

    Please, try this solution:

     

     Here is the sample code

     

    Left slicer is a switch between one year operations "1" (button slicer for control, from now-365 to now) and "All" dates.
    "0" - is another dates (not last year) of need.

     

    Best regs!