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
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())

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())

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.