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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Abrar786
Helper I
Helper I

Show current year and month as default in Filter Pane

Hi,

By default, I want to select the current year and the month prior to the current month in the filter. How can I accomplish this?

Abrar786_0-1687532581408.png

 

Thank you.

2 ACCEPTED SOLUTIONS
barritown
Super User
Super User

Hi @Abrar786,

You could create such a calculated column in your calendar table and use the filter [Target Month] = "yes" in your filter.

barritown_0-1687607198264.png

In plain text for convenience:

Target Month = 
VAR TargetMonth = MONTH ( TODAY() ) - 1
VAR TargetYear = YEAR ( TODAY () )
RETURN IF ( MONTH ( [Date] ) = TargetMonth && YEAR ( [Date] ) = TargetYear, "yes", "no" )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

View solution in original post

HamedM1125
Advocate III
Advocate III

Hi @Abrar786 

The below columns should resolve your concern. Just add the below columns to your filters.

 

1. Year = IF(YEAR('Table'[Date]) = YEAR(TODAY()),"Current Year",FORMAT('Table'[Date],"YYYY"))

2. Month = IF(MONTH('Table'[Date]) = MONTH(TODAY())-1,"Previous Month of Current Year",FORMAT('Table'[Date],"mmm"))

HamedM1125_0-1687636509063.png

 

Thanks,

Hamed

https://www.linkedin.com/in/hamed-mohammed-6aa073197/

 




View solution in original post

7 REPLIES 7
barritown
Super User
Super User

Hi @Abrar786,

Forgot to mention, if you plan to continue using your report in January, you may need to adjust the measure:

Target Month = 
VAR CurrentMonth = MONTH ( TODAY() )
VAR TargetMonth = IF ( CurrentMonth = 1, 12, CurrentMonth - 1 )
VAR TargetYear = IF ( CurrentMonth = 1, YEAR ( TODAY () ) - 1, YEAR ( TODAY () ) )
RETURN IF ( MONTH ( [Date] ) = TargetMonth && YEAR ( [Date] ) = TargetYear, "yes", "no" )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

HamedM1125
Advocate III
Advocate III

Hi @Abrar786 

The below columns should resolve your concern. Just add the below columns to your filters.

 

1. Year = IF(YEAR('Table'[Date]) = YEAR(TODAY()),"Current Year",FORMAT('Table'[Date],"YYYY"))

2. Month = IF(MONTH('Table'[Date]) = MONTH(TODAY())-1,"Previous Month of Current Year",FORMAT('Table'[Date],"mmm"))

HamedM1125_0-1687636509063.png

 

Thanks,

Hamed

https://www.linkedin.com/in/hamed-mohammed-6aa073197/

 




Abrar786
Helper I
Helper I

Hi @barritown ,

 

Thank you for the response. Using your approach, I am currently retrieving 'yes' or 'no' values in the filter. However, I would like the filter to display 'prior month' and 'current year' as the default options that are already checked by default.

Please let me know if you need any further assistance!

 

Abrar786_0-1687622184998.png

 

Hi @Abrar786,

I supposed you want to show data for the previous month of the current year on your dashbord. 

My solution marks all the days of the previous month of the current year with "yes". So if you leave only this new filter with "yes", you will get data for the previous month only and your "Month Name" filter will contain only May. If you want to access other months, you must select "No" - your "Month Name" filter will contain all the months but May.

 

barritown_0-1687623607810.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Hi @barritown ,

I am looking for a solution where users don't have to select anything. Whenever they open the report, it should display the default as the current year and the prior month's report without requiring any manual selection.

Hi @Abrar786,

Even better, please try to remove all the filters except the new one, select "yes" there - you will get the previous month of the current year on the dashboard.

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

barritown
Super User
Super User

Hi @Abrar786,

You could create such a calculated column in your calendar table and use the filter [Target Month] = "yes" in your filter.

barritown_0-1687607198264.png

In plain text for convenience:

Target Month = 
VAR TargetMonth = MONTH ( TODAY() ) - 1
VAR TargetYear = YEAR ( TODAY () )
RETURN IF ( MONTH ( [Date] ) = TargetMonth && YEAR ( [Date] ) = TargetYear, "yes", "no" )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors