Default value in slicer - single select drop down

Hi there,
I want to be able to default a value in single select drop down every time a page is being loaded (1st time-load). I went through old postings and there are some workarounds suggested, however they don’t work for my scenario.

Use Case:
Default the selection to be the “last shift available” every time user loads the report (1st time-load of the report)

E.g.
Shift available
image

User A - launched the report and drop down will auto-select last shift available - “2019/04/30 (Night)”. User selected diff shift = “2019/04/28 (Morning)” … then closed the browser/report

10 mins later , User A re-launched the same report, and the drop down will auto-select shift “2019/04/30 (Night)”.

If data refresh happened where there is a new last shift available in the dataset, I would like the report to auto-select the last shift as well.

thanks

Why not use a measure called last shift, then you can use SWITCH - if there is a selected val;ue retrun that if not then do a calculation for the latest shift.

Hope that helps
E

Have you tried creating a measure that finds the “Max” shift available and using that as a helper?

Hi @akiko_lim we’ve noticed that no response has been received from you since the 12th of August. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Thanks!

Hi @akiko_lim,

Usually when I want to have the default be the most current value, as in latest date or latest sprint, I create a calculated column that determines that flags that value, such as “Current”/“Older”. For yours, it could be the max night shift, provided they have a sort that will show it, which it seems it does for it to be at the top of the slicer.

Shift Group = if(ShiftsTable[Shifts]=CALCULATE(MAX(ShiftsTable[Shifts]),all(ShiftsTable)),“Current”,“Older”)

This can then be added in this slicer you have, making it a hierarchical slicer (which slicers support by default now). Then simply choose “Current” group as your default slicer option. They should always have the most recent selected first, and then they can choose a different one if they want. You can expand the whole slicer by right clicking on one in the dropdown, and choosing “Expand” --> “All”.

SlicerPersistent

To get around the user filters, then comes back, there is an option in report settings to “Don’t allow end user to save filters on this file in the Power BI Service”, it’s the top option going File --> Options and Settings --> Options --> Current File --> Report Settings.

Hope this helps, and if you need more explanation, let me know and I’ll provide an example.

2 Likes

Thanks Datazoe,

Let me try this. Appreciate your input.

Hi @akiko_lim, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box. Also, we’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!