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! Request now

Reply
spagad6263
Post Patron
Post Patron

Is there a way to limit month dimension when comparing current year with last year?

Hi,

 

I created a comparison chart for this financial year and same month last year. Our financial year starts from Apr. Below is the chart shows the comparison but I would like to remove the months such as Nov 2022, Dec 2022, as we are only in Oct 2023. Any suggestions?

 

spagad6263_0-1696475457333.png

 

Below is what I would like to see

spagad6263_0-1696475720893.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@spagad6263 ,

I am hoping you are using a date table

 

Try

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

or

 

Year behind Sales = if( Max(Date[Date]) <= today() , CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date])) , blank())

Share with Power BI Enthusiasts: 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
spagad6263
Post Patron
Post Patron

I used the second one and it works beautifully. Much appreciated!

amitchandak
Super User
Super User

@spagad6263 ,

I am hoping you are using a date table

 

Try

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

or

 

Year behind Sales = if( Max(Date[Date]) <= today() , CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date])) , blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
Top Kudoed Authors