Forum Discussion
jerryr125
1 year agoHelper IV
Page - default value for slicing the data
Hi - Question. I have a page in my Power BI application in which I would like to have the visualizations default to a specific slicer value. I have a slicer that lets user select the week # and o...
- 1 year ago
Here is the general approach. Adjust as needed
- create a string representation of your date column, replace the latest date with a string "Latest"
- sort that new column by the original date column
- add a slicer or visual/page/report level filter
- set the filter to "Latest"
- publish the pbix to the workspace/app
rajasaadk_98
1 year agoHelper I
Yes, you can definitely set a slicer to default to the maximum value (e.g., the latest week) in Power BI, and then allow users to select other week numbers from there. Here's how you can achieve this:
Steps to Default a Slicer to the Maximum Week Number:
Option 1: Using a Measure for the Max Week Number
Create a Measure for the Max Week:
- Go to the Data view and make sure you have a Week Number column in your data (if not, create one).
- Create a new measure to get the maximum week number.
Use the following DAX expression to create this measure:
DAXCopy codeMaxWeek = MAX(YourTable[WeekNumber])Use the Measure to Filter the Visuals:
- Add this measure as a visual filter to all your visuals. Set it to filter for Week Number equals MaxWeek.
Add a Slicer for Week Selection:
- Add a Week Number slicer to the page. This will allow users to change the week as needed.
- The visuals will load with the latest week (MaxWeek) by default, but users can change the selection to any week they prefer.