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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.