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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Set default limits for between date filter

Hello to you,

 

my issue is pretty simple to explain but I haven't found anything to solve it.

 

I have a normal date filter with "between" mode:

 

1.png

 

I need to model it so that when I open the report start and end date are not the minimum and the maximum ones but they should be set to show data from last completed month. For example:

  • if today it's April, 30th --> it should be set from March, 1st to March, 31st
  • if it's May, 1st --> it should be set from April, 1st to April, 30th

Then if I want to change the date range of course I can, but when I open it I should find it set showing last completed month. I can do it with a bookmark, but I want to know if there is a way to do it directly without creating any bookmark.

 

Is there a way?

 

Thank you so much.

 

Nick

10 REPLIES 10
amitchandak
Super User
Super User

Anonymous
Not applicable

Thank you @amitchandak for your hint.

 

Well it would be nice, but I'd need to keep the filter in between mode and opening it with last month already selected dynamically. You suggestion is good but I want to have this kind of slicer and possibly add some code/column/measure/whatelse to achieve it.

Greg_Deckler
Super User
Super User

So generally you would create a calculated column to flag last month dates and then use that as a filter in your slicer.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thank you @Greg_Deckler  for answering.

 

I already tried but if I use this filed as a visual filter it doesn't work. I see it works if I use a date column on my data table but I am using data coming from Calendar function (my field is Date = CALENDAR(MIN(My_Date); MAX(My_Date)) ) and it looks not influenced by the filter you are suggesting.

So is that Date a table in the model?


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler  yes, it comes from a table built with Calendar fuction right to create this date field

@Anonymous 

 

You may refer to the post below.

https://community.powerbi.com/t5/Desktop/i-have-two-dates-using-measures-and-want-to-set-these-dates...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks @v-chuncz-msft this is pretty simple but good. I already thought to it, I'd like to know if there is a way to do it without adding any visual but simply open the report with dates already set on last month.

So can't you add your flag column to that table?


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler if you mean adding the flag column to the visual level filter, yes I can but it has no effects and dates still remain to normal range without being influenced by it. I see it doesn't happen if I don't use Calendar date but a date field from my data, but I need Calendar because I need every single day and not just days for which there is a record.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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