Forum Discussion

AkshayManke's avatar
AkshayManke
Helper II
2 years ago
Solved

Set the Date Filter to Blank as Default

Hello,

 

I want to allow users to select a specific date using the date filter. The filter is configured and accepting the dates. But i want that initially the dafault value should be blank. How to do that please?

 

FYI Please. I have three dates filters for now and i want to set all of them to be blank.

 

Thanks in advance.

 

Regards,

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi AkshayManke ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    Note that the date columns here are of text type.

    (2) Get more visuals->Search Preselected Slicer.

    (3) We can create a table.

    _PreselectedSlicer = DATATABLE(
        "IsDirtySlicer", BOOLEAN, 
        {
            {FALSE()},
            {TRUE()}
           
        }
    )

    (4) We can create a measure.

    _Dafault = 
    VAR _SelectedWeek = SELECTEDVALUE('Table'[Date])
    VAR _Dafault =BLANK()
    
    RETURN 
     _SelectedWeek=_Dafault

    (5) Then the result is as follows.

    If your date is listed as a date type, the result is as follows, which is due to design.

     

    Best Regards,

    Neeko Tang

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

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AkshayManke ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    Note that the date columns here are of text type.

    (2) Get more visuals->Search Preselected Slicer.

    (3) We can create a table.

    _PreselectedSlicer = DATATABLE(
        "IsDirtySlicer", BOOLEAN, 
        {
            {FALSE()},
            {TRUE()}
           
        }
    )

    (4) We can create a measure.

    _Dafault = 
    VAR _SelectedWeek = SELECTEDVALUE('Table'[Date])
    VAR _Dafault =BLANK()
    
    RETURN 
     _SelectedWeek=_Dafault

    (5) Then the result is as follows.

    If your date is listed as a date type, the result is as follows, which is due to design.

     

    Best Regards,

    Neeko Tang

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

    • foodd's avatar
      foodd
      Community Champion

      Hello Anonymous , What would your alternative solution be if the Custom Visual Preselected Slicer were suddenly unavailable?   Can you provide this in a form with a stock visual available now?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi foodd ,

         

        Unfortunately, the default slicer visual doesn't support pre-selected values, and you can post your ideas on the Idea forum. 

        https://ideas.powerbi.com/ideas/

         

        Best Regards,

        Neeko Tang

  • ajohnso2's avatar
    ajohnso2
    Solution Supplier

    Since slicers are based off the values in your tables how do you expect to default it to <BLANK>?

    You could default to a particular date i.e always the current days date