Forum Discussion

ToniHeinrichsIB's avatar
ToniHeinrichsIB
Frequent Visitor
3 years ago
Solved

Relative time filter with always one option selected

Hi!

 

I build this time filter with 4 options "last 7 days","last 15 days","last 30 days","since the beginning". It works very well but if none of the options is selected, no data is displayed. Is there a way to always select "since the beginning" in case the other options are deselected. The thing is I would always have at least one option selected all the time.

Relative time filter

 

Thanks in advanced,

 

Toni Heinrichs

  • v-yueyunzh-msft's avatar
    v-yueyunzh-msft
    3 years ago

    Hi , ToniHeinrichsIB 

    For the slicer in Power BI , If you don't select a slicer, all filtering contexts are calculated by default. We have no way to modify the slicer, we can only modify our measure, we can use the isfiltered() function to judge the slicer, and when the slicer is not selected, all data is returned.

    For more information, you can refer to :
    ISFILTERED function (DAX) - DAX | Microsoft Learn

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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

3 Replies

  • Hi , ToniHeinrichsIB 

    Depending on your description, you want the slicer to select a value by default. This option is not available for default slicers, but you can try using the custom visual preselected slicer in combination with a sync slicer to achieve your needs.

    You can refer to this case:

    Solved: How to set last 2 months as default filter in a po... - Microsoft Power BI Community

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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

    • ToniHeinrichsIB's avatar
      ToniHeinrichsIB
      Frequent Visitor

      Hi v-yueyunzh-msft . I think I didn't explain myself enough, i don't want just a value by default. I would like that the slicer always has one option selected, that is, you can't leave the slicer without an option selected and if you try to deselect and option, one option should be selected by default.

       

      I tried the preselected slicer, but unfortunetly it doesn't meet my requierements (although I may use it in the future for other projects). I would like that this scenario can't happen, that is, the slicer doesn't have any option selected. (I would always like that the slicer always has at least one option selected)

       

      Best regards,

       

      Toni Heinrichs

      • v-yueyunzh-msft's avatar
        v-yueyunzh-msft
        Icon for Community Support rankCommunity Support

        Hi , ToniHeinrichsIB 

        For the slicer in Power BI , If you don't select a slicer, all filtering contexts are calculated by default. We have no way to modify the slicer, we can only modify our measure, we can use the isfiltered() function to judge the slicer, and when the slicer is not selected, all data is returned.

        For more information, you can refer to :
        ISFILTERED function (DAX) - DAX | Microsoft Learn

         

        Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

         

        Best Regards,

        Aniya Zhang

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