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

Default date doesn't roll over to the next month in a slicer

Hi all,

 

I created a calculated column to get the current date and put it in a slicer to have TODAY by default. Then I added other calculated columns with a month name and year. The problem is when the current date hits the next month it can't roll over and is stuck in the same month. So I have to pick another "Today" in the next month.

powerbiuser444_1-1629145146000.png 

powerbiuser444_2-1629145421833.png

 

The logic in my columns is straightforward.

 

SlicerDate = IF([Date]=Today(),"Today",[Date]&"")
Month = FORMAT(DATE(1, MONTH([Date]), 1), "MMM")
Year = YEAR([Date])
 
Could you help to overcome that or should I use another logic?
1 ACCEPTED SOLUTION

@powerbiuser444 Use more than one slicer. One for year, one for month and one for date/today. Not ideal?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

@powerbiuser444 Seems like this has to do about having a hierarchy in your slicer. If you look at the Data view for your table I imagine that you do not actually have any dates in July flagged with Today?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler yes, it's true. July's 'Today' is empty, once I manually pick August's 'Today', July's 'Today' disappears. So this logic works only within a month, the 'Today' flag doesn't roll over to the next month.

@powerbiuser444 That's what I figured. The issue is the use of the hierarchy in the slicer, not the DAX code or anything like that. If you didn't have the hierarchy, you wouldn't have the problem... 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler I understand that but how can I combine month and date? If I want to see the whole month selecting 30 days is not an option

@powerbiuser444 Use more than one slicer. One for year, one for month and one for date/today. Not ideal?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler if it's the only option then okay, not ideal but what can I do. Anyway thanks for your replies

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.