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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
randomUser21
Resolver I
Resolver I

How can i set segment default selected value ?

Hello everyone,

How do I set a default selected value on the segment?

example:

today is 10/18/2023 (dd/mm/yyyy), I want the default selected date to be 10/01/2023 to 10/18/2023. and the user can modify this segment value without modifying the filters.

Can anybody help me ?
Thanks
best regards

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @randomUser21 ,

 

For the slicer that comes with Power BI, we can not get it. But we can get the three point in the "Visualizations", and we click the "Get more visual":

Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.

vyangliumsft_0-1697767276801.png

 

Here are the steps you can follow:

1. First , we need to create a table with one column , and the value is True and False, like this

vyangliumsft_1-1697767276803.png

2. Second , we can create a measure to define which the date we need to default preselected. If we need to default preselect then we return True else return False.

Flag =
var _date=
SELECTEDVALUE('Table'[Date])
var _today=TODAY()
var _min_date=
DATE(YEAR(_today),MONTH(_today),1)
return
IF(
    _date >= _min_date && _date<= _today,TRUE(),FALSE())

3. Then we can put the 'Table'[Date] in the Fields , [Flag] in the Pre Selection , 'Dirty Table'[Dirty Status] in the Dirty Status, like below screenshot:

vyangliumsft_2-1697767299402.png

4. Result:

 

vyangliumsft_3-1697767299404.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
Anonymous
Not applicable

Hi  @randomUser21 ,

 

For the slicer that comes with Power BI, we can not get it. But we can get the three point in the "Visualizations", and we click the "Get more visual":

Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.

vyangliumsft_0-1697767276801.png

 

Here are the steps you can follow:

1. First , we need to create a table with one column , and the value is True and False, like this

vyangliumsft_1-1697767276803.png

2. Second , we can create a measure to define which the date we need to default preselected. If we need to default preselect then we return True else return False.

Flag =
var _date=
SELECTEDVALUE('Table'[Date])
var _today=TODAY()
var _min_date=
DATE(YEAR(_today),MONTH(_today),1)
return
IF(
    _date >= _min_date && _date<= _today,TRUE(),FALSE())

3. Then we can put the 'Table'[Date] in the Fields , [Flag] in the Pre Selection , 'Dirty Table'[Dirty Status] in the Dirty Status, like below screenshot:

vyangliumsft_2-1697767299402.png

4. Result:

 

vyangliumsft_3-1697767299404.png

 

Best Regards,

Liu Yang

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

@Anonymous  Thank you for your answer ,
this is not possible on the calendar segment?
I tried your solution it works well but this form will not suit my users they would have needed a calendar.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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