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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
AFoisAnalytics
Frequent Visitor

How to default the data in a table or visual based on the current day of the month

Hi all,

 

I need to filter the data shown in a table and in the charts of the report automatically at the opening, with this logic:

 

if today the month day is < 20, the report needs to show the data starting from the last day of 2 precedent month. So for example if Today is 18 of March the data should start from last day of January.

 

Instead, if today the month day is >= 20, the data shown should start from the last day of the past month. So if Today is 21 of March the data should start from last day of February.

 

How could I do this?  

 

Thank You 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @AFoisAnalytics ,

I created some data:

vyangliumsft_0-1664158003097.png

Here are the steps you can follow:

1. Create measure.

Flag =
var _today=TODAY()
var _day=DAY(_today)
return
 IF(
     _day>=20&&MAX('Table'[Date])>=EOMONTH(_today,-1),1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1664158003099.png

3. Result:

vyangliumsft_2-1664158003104.png

 

Best Regards,

Liu Yang

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @AFoisAnalytics ,

I created some data:

vyangliumsft_0-1664158003097.png

Here are the steps you can follow:

1. Create measure.

Flag =
var _today=TODAY()
var _day=DAY(_today)
return
 IF(
     _day>=20&&MAX('Table'[Date])>=EOMONTH(_today,-1),1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1664158003099.png

3. Result:

vyangliumsft_2-1664158003104.png

 

Best Regards,

Liu Yang

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

lbendlin
Super User
Super User

- add a calculated column to your calendar table that implements the required logic as needed (include/exclude)

- use that column as the default filter in your report but allow your users to change it.

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.