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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
aditi1997yadav
Frequent Visitor

How to make latest date in dataset the default selection for hierarchy date slicer in power BI

I am trying to make the latest  date in my dataset as the default selection for hierarchy date slicer, however i am unable to do so..  i tried tons of videos nothing is working. any help would be appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

Thanks for the solution Ritaf1983 , Kedar_Pande , danextian  and lbendlin offered, and i want to offer some more information for user to refer to.

hello @aditi1997yadav , based on your description, you can refer to the following solution.

If you want to select the latest date in date hierachy, the default slicer cannot offer the default selection , you can consider the following.

Create a measure.

Flag =
VAR _year =
    MAXX ( ALLSELECTED ( 'Calendar'[Date].[Year] ), [Date].[Year] )
VAR _quarter =
    MAXX ( ALLSELECTED ( 'Calendar'[Date].[QuarterNo] ), [Date].[QuarterNo] )
VAR _month =
    MAXX ( ALLSELECTED ( 'Calendar'[Date].[MonthNo] ), [Date].[MonthNo] )
RETURN
    IF (
        SELECTEDVALUE ( 'Calendar'[Date].[Year] ) = _year
            && SELECTEDVALUE ( 'Calendar'[Date].[QuarterNo] ) = _quarter
            && SELECTEDVALUE ( 'Calendar'[Date].[MonthNo] ) = _month,
        1,
        0
    )

Then put it to the visual filter.

vxinruzhumsft_0-1735006707639.png

 

Output

vxinruzhumsft_1-1735006718035.png

 

Another solution is that you can consider to use the preselected slicer, it will display all date without hierachy, but it can preselect the latest date.

Dowload the visual from the Appsource

vxinruzhumsft_2-1735006961204.png

 

Then create a true/false table.

vxinruzhumsft_3-1735007001655.png

 

Then create a measure.

MEASURE =
IF (
    SELECTEDVALUE ( 'Calendar'[Date] )
        = MAXX ( ALLSELECTED ( 'Calendar'[Date] ), [Date] ),
    TRUE (),
    FALSE ()
)

Then create a preselected slicer visual, and input the following field to the slicer.

vxinruzhumsft_4-1735007072684.png

 

Output

vxinruzhumsft_5-1735007084802.png

 

It will select the latest date as a default value.

 

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.

 

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi,

Thanks for the solution Ritaf1983 , Kedar_Pande , danextian  and lbendlin offered, and i want to offer some more information for user to refer to.

hello @aditi1997yadav , based on your description, you can refer to the following solution.

If you want to select the latest date in date hierachy, the default slicer cannot offer the default selection , you can consider the following.

Create a measure.

Flag =
VAR _year =
    MAXX ( ALLSELECTED ( 'Calendar'[Date].[Year] ), [Date].[Year] )
VAR _quarter =
    MAXX ( ALLSELECTED ( 'Calendar'[Date].[QuarterNo] ), [Date].[QuarterNo] )
VAR _month =
    MAXX ( ALLSELECTED ( 'Calendar'[Date].[MonthNo] ), [Date].[MonthNo] )
RETURN
    IF (
        SELECTEDVALUE ( 'Calendar'[Date].[Year] ) = _year
            && SELECTEDVALUE ( 'Calendar'[Date].[QuarterNo] ) = _quarter
            && SELECTEDVALUE ( 'Calendar'[Date].[MonthNo] ) = _month,
        1,
        0
    )

Then put it to the visual filter.

vxinruzhumsft_0-1735006707639.png

 

Output

vxinruzhumsft_1-1735006718035.png

 

Another solution is that you can consider to use the preselected slicer, it will display all date without hierachy, but it can preselect the latest date.

Dowload the visual from the Appsource

vxinruzhumsft_2-1735006961204.png

 

Then create a true/false table.

vxinruzhumsft_3-1735007001655.png

 

Then create a measure.

MEASURE =
IF (
    SELECTEDVALUE ( 'Calendar'[Date] )
        = MAXX ( ALLSELECTED ( 'Calendar'[Date] ), [Date] ),
    TRUE (),
    FALSE ()
)

Then create a preselected slicer visual, and input the following field to the slicer.

vxinruzhumsft_4-1735007072684.png

 

Output

vxinruzhumsft_5-1735007084802.png

 

It will select the latest date as a default value.

 

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.

 

Ritaf1983
Super User
Super User

Hi @aditi1997yadav 
I attached a pbix with the example that I prepared please download and check if it helps.
Feel free to ask questions.

Ritaf1983_0-1734934275681.png

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

i actually wanted for quarters as well, and when i add quarter it selects all the months in that latest quarter.. i wanted my default selection as year+quarter+month

Hi @aditi1997yadav 

It doesn’t matter at what level; everything works based on the same logic.
If you can’t adapt my solution to your logic, simply attach a link to a PBIX file with basic data such as your date, measure, and calendar table, and show the desired result.

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Kedar_Pande
Super User
Super User

danextian
Super User
Super User

Hi @aditi1997yadav 

 

If you want the latest date itself to be selected at each refresh then you need to use an external tool called tabular editor and leverage the Group by Columns property to "store a filter by using an alternate value, which represents the key of the entity." Power BI uses this key to store the filter, allowing the corresponding filter value in the visual to change dynamically.

danextian_0-1734933018683.png

danextian_1-1734933076236.png

Here's a demo: https://youtu.be/MrEAZREQuXM?si=mtCRhSpSXiaJcxGO

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
lbendlin
Super User
Super User

Is the table that holds that date in import mode?  Have you created a calculated column for the "Latest"  value?

 

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors