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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.