Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
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.
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
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:
4. Result:
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
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.
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
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:
4. Result:
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 61 | |
| 43 | |
| 40 | |
| 38 | |
| 22 |
| User | Count |
|---|---|
| 178 | |
| 124 | |
| 116 | |
| 77 | |
| 54 |