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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
IshaDahra
New Member

Dynamic preselected selection in PowerBI slicer

I am working on automation of a task which contains monthly data. I want my slicer to be automatically select the latest month data available whenever the data refreshes

14 REPLIES 14
wardy912
Impactful Individual
Impactful Individual

Hi @IshaDahra 

 

 Ensure your month column is sorted by a number column.

Add your slicer and make sure it's sorted by the month column descending.

Enable single select.

wardy912_1-1754997245247.png

 

If you want to dynamically filter your page every time, just add the month column to the filter pane.

Select 'relative date', 'is in this month'

 

wardy912_2-1754997355790.png

I hope this helps, please give a thumbs up and mark as solved if it does, thanks!

 

 

 

From this, if next month's data is updated the previous month's data from slicer is not getting removed

Hi  @IshaDahra  , 

Thanks for reaching out to the Microsoft fabric community forum. 

I would also take a moment to thank @mdaatifraza5556 , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference. 

Can you please confirm whether the issue got resolved or not.
Thank you.

Hi @IshaDahra ,

Can please confirm whether the issue has been resolved. If it is solved can you please share the workaround here.

Best Regards, 
Community Support Team.

Hi @IshaDahra ,

Can you please confirm whether the issue got resolved or not.
Thank you.

Hi @IshaDahra 

Can you please share the snapshot of the slicer how you want 

you want to show only current month name in the slicer or something else


In my approch it will always select the current month having in your dataset 


If this answers your questions, kindly accept it as a solution and give kudos.

Hi @IshaDahra 

Can you please try the below steps to get your result ?

This is based on the max date you have in your table ( either it is max date as per you data or it is related to today)

1. Create a calculated column in your date table using below dax 
    

MonthLabel =
VAR CurrentMonth =
    EOMONTH('date'[Date], 0)
VAR LatestMonth =
    CALCULATE(
        MAXX(ALL('date'), EOMONTH('date'[Date], 0)),
        REMOVEFILTERS('date')
    )
RETURN
IF(
    CurrentMonth = LatestMonth,
    "Latest Month",
    FORMAT('date'[Date], "MMM-YYYY")
)
 
 
Screenshot 2025-08-12 165045.png

 

Now add a slicer ( use MonthLabel column) and select the Latest Month and then published it to the workspace.

whenever the use open the report it is always Latest Month is selected, later or you can change the month or by the help of year slicer you can also adjust this.

Result 
Screenshot 2025-08-12 165807.png

 

If this answers your questions, kindly accept it as a solution and give kudos.

I have put Month name's name in slicer, if the latest month data in slicer is July-2025 and I publish it. Then, the data of August is loaded in folder to automatically refresh the dashboard, the selection of slicer doesn't changes to August

Hi @IshaDahra 

As you can see i have created a calculated column

In which i have named for current month to show Latest Month ( in calculated col)

and in the slicer i just selected Latest Month, Now whenever the new month data is added then that calculated column is re-run when it get refresh then again Latest Month will give the current month which is added into it .

I have just tried with a sample by adding next month for 1999. and it's working 



If this answers your questions kindly accept it as a solution and give kudos.


jaineshp
Memorable Member
Memorable Member

@IshaDahra

It would be great if you provide the data as well.

Best regards,
Jainesh Poojara / Power BI Developer

It's month's names

@IshaDahra ,
There is no direct way to select the latest month always in the slicer upon data refresh but we have workaround.

Create a new calculated column based on the existing date column which will contains monthyear format as you mentioned for other months and "Current month" text for latest month. This will update as on when data is refreshed. Use this newly created calculated column in the slicer.

 

Please refer the file attached.





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

Proud to be a Super User!


LinkedIn


Arul
Super User
Super User

@IshaDahra ,

What kind of data you are using in the slicer ?

 





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

Proud to be a Super User!


LinkedIn


It's Month names

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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