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
dbowman
Frequent Visitor

Leap year - year over year by month issue

Hello,

We are trying to do a year over year comparison by month. Every year works great except for when the previous year was a leap year. Please see below for the behavior. We are using the SAMEPEROIDLASTYEAR expression.

Any help is appreciated and thank you!

 

Previous Year - Completed = CALCULATE((SUM('Month'[Issued Count])+sum('Month'[Canceled Count])+sum('Month'[Declined Count])),SAMEPERIODLASTYEAR('Month'[Month End Date]),ALL('Month'))

YoverY.jpg

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@dbowman ,

 

You may try PREVIOUSYEAR() instead. Please refer to: https://docs.microsoft.com/en-us/dax/previousyear-function-dax. However, if this issue persists, could you share some sample data and clarify more details about your expected result?

 

Community Support Team _ Jimmy Tao

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

Hi @v-yuta-msft,

Thanks for your response. This is not working either. And we also have another issue now.

 

Current year count is a value from the month query.

Previous Year - Received = CALCULATE(SUM('Month'[Month Received Count]),SAMEPERIODLASTYEAR('Month'[Month End Date]),ALL('Month'))

Year in chaart is a value on the month query.

Month end date is a value on the month query.

Year slicer is a value from teh dates query, related to the month query.

 

Issue 1. Previous year being a leap year, breaking the month of February visual.

YoverY.jpg

 

Issue 2. Previous year measure not showing at all on visual unless more than one year selected in slicer.

multiple.jpgsingle.jpg

 

Thanks,

 

David

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.