Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Default slicer value

  • Hi all, 

 

I was wondering if anyone could help on this am I have a requirement to make power bi slicer defaults to the latest date the data load in my model. I have been able to create calculated column with 

Latestdate= IF (file[date]=Max(filedate) 'Current-file', " " & file[date].

 

I have then used this as a slicer where selection is default to Current-file text . I however would like to see a date instead of current-file,

 

thanks if you can help.

7 Replies

  • v-yadongf-msft's avatar
    v-yadongf-msft
    Community Support

    Hi Anonymous ,

     

    This is my test table:

     

    If you want to get the latest date, please create a new column like below:

    Latestdate = MAX('Table'[Date])

     

    Create a slicer:

     

    Best regards,

    Yadong Fang

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi v-yadongf-msft  thanks . 
    but my question was how do I make the current date default selection when it is published to power BI service . 

    • v-yadongf-msft's avatar
      v-yadongf-msft
      Community Support

      Hi Anonymous ,

       

      Can you share with me some screenshots of your data after hiding sensitive information and tell me what's your expected output?

       

      Thanks for your efforts & time in advance.

       

      Best regards,

      Yadong Fang

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi above is my slicer where i use calculated column to grab Current_file 

        with  Max(Table[datecolumn])

        is there a way to show current_file the actual date let say 21 october instead 

  • You have already done the workaround to select a latest date, which is to add a calculated column and map the latest date with  "Latest Date".
    As of now, i dont think there is a workarround to get the actual latest date automatically changing with latest date for each refresh in a Power BI native slicer.
    it stick with the date if selected, even if the data is not available for that day, you need to manually unselect that selection.
    For a workarround, you can use  Slicer type "Between", and select the full date range in the slider.

    Check out below for Interesting Power BI and DAX solutions.
    https://www.youtube.com/c/PowerBIHelpline/