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, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
jerryr125
Helper I
Helper I

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 of course, the visualizations on the page change as one or many week #'s are selected.  BUT, is there a way in which to default the page to the greatest (max) value of the week # and then have the users proceed in the selecting the specific week #s from there (like if they wish to go back in time).

 

Any thoughts ? Jerry

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User


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

View solution in original post

2 REPLIES 2
rajasaadk_98
Helper I
Helper 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

  1. 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:

    DAX
    Copy code
    MaxWeek = MAX(YourTable[WeekNumber])
  2. 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.
  3. 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.
lbendlin
Super User
Super User


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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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