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! Request now

Reply
tina345
Helper II
Helper II

How to default 'Year_Month_Code' to pick the latest value when we load report

Hello,

   I don't see any option to pick default value on a slicer.

   

  I have a table which has different year_month_code values and when I launch power bi report, it picks any random value and loads the report.

 

    Is there a way on power BI to use latest 'year_month_value' that my table has to be default value when launching the report link?

   So everytime when I click report link, it displays latest one?

 

    Thanks 

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @tina345 

 

Please refer to this video. There's a downlodable sample file in the video description.

https://www.youtube.com/watch?v=MrEAZREQuXM 

 

Please note that if persistent filter is enabled in the service, the slicer selection will default to the user's saved slicer selections.





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.

View solution in original post

shafiz_p
Super User
Super User

Hi @tina345  As I can understand that you want to pick latest year-month value as default value on slicer. You can try this method to acheive this:

shafiz_p_0-1737278097440.png

shafiz_p_1-1737278130923.png

 

Lastly sort Month-Year by Month-YearSortIndex:

shafiz_p_2-1737278181675.png

 

Now you can create a slicer with month-year by single select.

shafiz_p_3-1737278333568.png

 

Or, you can create a measure and use in the visual label filter. 

LatestYearMonthCode = IF(MAX('CalendarTable'[Month])=MONTH(TODAY()) && MAX(CalendarTable[Year]) = YEAR(TODAY()), 1, 0)

shafiz_p_4-1737279010293.png

 

Hope this helps!!

If this solved your problem, please accept it as a solution!!

 

Best Regards,
Shahariar Hafiz

View solution in original post

2 REPLIES 2
shafiz_p
Super User
Super User

Hi @tina345  As I can understand that you want to pick latest year-month value as default value on slicer. You can try this method to acheive this:

shafiz_p_0-1737278097440.png

shafiz_p_1-1737278130923.png

 

Lastly sort Month-Year by Month-YearSortIndex:

shafiz_p_2-1737278181675.png

 

Now you can create a slicer with month-year by single select.

shafiz_p_3-1737278333568.png

 

Or, you can create a measure and use in the visual label filter. 

LatestYearMonthCode = IF(MAX('CalendarTable'[Month])=MONTH(TODAY()) && MAX(CalendarTable[Year]) = YEAR(TODAY()), 1, 0)

shafiz_p_4-1737279010293.png

 

Hope this helps!!

If this solved your problem, please accept it as a solution!!

 

Best Regards,
Shahariar Hafiz

danextian
Super User
Super User

Hi @tina345 

 

Please refer to this video. There's a downlodable sample file in the video description.

https://www.youtube.com/watch?v=MrEAZREQuXM 

 

Please note that if persistent filter is enabled in the service, the slicer selection will default to the user's saved slicer selections.





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.

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
Top Kudoed Authors