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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
supriyakhamesra
New Member

Show the first value in single select slicer in Power BI report as default value

I am having a Power BI report which have a single select slicer . The data in the slicer is updating dynamically and want that whenever a report is rendered the top most value should always be selected and repective data should get displayed. But currently when the data get updated it always shows the last selected value even if it is not there in the list. So, need to resolve this issue and always want the top most value to be default selected.

4 REPLIES 4
v-xinruzhu-msft
Community Support
Community Support

Hi @supriyakhamesra 

 

You can try to use custom visual :preselected slicer

vxinruzhumsft_0-1669713273567.png

 

 please get it from visual store

e.g put the date into the slicer, then create a new measure to get the latest date

Measure 2 = var _slicer=SELECTEDVALUE('Table'[Date])

var _max=MAXX(ALL('Table'),[Date])

return

IF(_slicer=_max ,TRUE(),FALSE())

Then put it into the visual field,

Create a new table

vxinruzhumsft_1-1669713273568.png

 

Then put the field into the visual field, it can realize the default choice

vxinruzhumsft_2-1669713273573.png

 

Best Regards,

Yolo Zhu

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

Hi ,

I tried preselected slicer. Initially it appeared to work . But when my data get refershed and and there is no older value and only new single value is there then the updated value is appearing but is not default selected. On refreshing the data in Power BI desktop too it is not default selected with the latest value. Any idea what can be the issue.

supriyakhamesra_0-1670865862534.png

 

 

sudhav
Helper V
Helper V

Just try it, i am not sure, in slicer, you can use relative date or relative time method, here you can select last one hour data/last n hours data/last 1 day/last week/last 1 month/this week/this month data like this... just try it if yr data is getting update by weekly or monthly or daily or hourly.....

 

please let me know if its works....

ibarrau
Super User
Super User

Hi. There is no feature in PowerBi that will let you change the value of a slicer dynamically to set a default value. You need to find other place to create that dynamic filter, like the transformations of your dataset. You could filter that on PowerQuery, but that means only showing data for that filtered data.

The only approach I can think now would be build a custom column at your data that could identify the entity you want to filter if it's the top most value, like a flag (0 or 1 or any text to filter the value). Then just add that slicer next to the one you have now. It might be more user friendly if it's a text, slicer with two values "Top Most Value", "Other Values". That slicer can be saved as the default of the user and the data will change but the selection wouldn't. At the end you need to let the other filter a select all or none selection to let this one work.

I hope that helps,


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

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors
Top Kudoed Authors