Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ToniHeinrichsIB
Frequent Visitor

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 filterRelative time filter

 

Thanks in advanced,

 

Toni Heinrichs

1 ACCEPTED SOLUTION

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

View solution in original post

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

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

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)

Captura de pantalla_20221223_102012.png

 

Best regards,

 

Toni Heinrichs

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.