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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mohit_K
Helper I
Helper I

How to set a date slicer to current month by default ?

Hi,

 

I have a date slicer with two years of data. I want set the slicer to current month by default so that when the month changes I will not have to republish the report.

 

When the end user opens the report, he should be able to view the current month data by default. If the user wants to view the report for the previous months then he can use the date slicer for that. But by deafult he should see current month only.

 

So when the month changes, the report should also dynamically change.

 

 

We tried the below method by creating a static column for This month and last month and save page with that value in the slicer.

 

A new column in date table of table in use

 

Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1*month(Today())),"Last year Last Month" ,
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

 

But from the end user point of view it seems to be a bit confusing. The end user should simply see the names of the months. 

 

Is there any other way ?

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @mohit_K ,

 

For this feature request, please focus on this idea:

https://ideas.powerbi.com/ideas/idea/?ideaid=39ba67cf-724e-4b6c-9906-51163749f759 

At this stage, we can create a column with default as workaround.

https://gorilla.bi/power-bi/set-default-slicer-value/ 

 

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

amitchandak
Super User
Super User

@mohit_K , I know the solution you have is not the best one. But seem like that workaround has to be used as of  now.

You can display the selectedmonth on a card or title.

There are a few ideas around that. please vote for those

https://ideas.powerbi.com/ideas/

 

Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.