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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JoSwinnen
Helper I
Helper I

Show the current month by default and the latest N months

Hi, 

 

I'm trying to find a solution where I have two slicers: year and month. I find a lot of different solutions on the forum. When I open Power BI, I want to show by default the current year and the current month. I saw already a lot of posts about this, but they are a couple of years old, I don't know whether there is a recent solution for this?

 

But I also want to create a third slicer where you can select how many months are shown in the visualisations. For instance I have a line graph with on the x axis the months and it shows the sales. 

So in the slicer month it says current month, but in the third slicer I want to select how many months to show in the past: 5, 12, 25, ... 

 

Thanks a lot,

 

Jo 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@JoSwinnen , Still you have to use a workaround only m to have columns like this year and this month

 

Is This Year = if('Date'[Date]>=date(Year(TODAY()),1,1) && 'Date'[Date]<=TODAY(),"This year",[Date]&"")

 

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

 

and you need save on this year and this month

Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
JoSwinnen
Helper I
Helper I

Thanks! It works. 

amitchandak
Super User
Super User

@JoSwinnen , Still you have to use a workaround only m to have columns like this year and this month

 

Is This Year = if('Date'[Date]>=date(Year(TODAY()),1,1) && 'Date'[Date]<=TODAY(),"This year",[Date]&"")

 

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

 

and you need save on this year and this month

Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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