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
Bridgett
New Member

Same Period Last Year not calculating correctly with date filter

Hi All, 

 

Having some issues I am hoping you can help with

 

I have a Calendar Table that I created in Power BI - basically using the principles in the link here 

https://exceleratorbi.com.au/build-reusable-calendar-table-power-query/

 

In essence, It has a "Date"column from 01/01/2014 to the current date

 

My data table - called "SellThrough" is linked to the "Calendar" Table via the "Date" Column (Many to One relationship, Single Cross Filter direction, Active relationship)

 

The data table in question has a column called "Sell through (Units)" which I have two measures calculating from:

 

Total Sum Sell through = sum(Sellthrough[Sell through (Units)])

Total Sum Sellthrough LY = CALCULATE([Total Sum Sell through],SAMEPERIODLASTYEAR('Calendar'[Date]))

 

This is to compare last year sales vs this Year sales for the same period

 

However, when I add any sort of Date filtering (using Date function from my created "Calendar" Table), The Total Sum Sell through is calculated correctly, however Total Sum Sellthrough LY is not and is displaying a result that I don't know where it is coming from!

 

When in a table it seems to have the correct information in the body, but the total is some random quantity!

 

I have a sample PBIX file that I can send and I have an image of an example of what is happening if anyone thinks they can shed some light on the issue, however for some reason I can't attach either here

 

Thanks!

3 REPLIES 3
nate17
Regular Visitor

Hi I have exactly the same issue. Did you find a resolution to this?

Bridgett
New Member

Date TY vs LY issue.PNG

Figured out how to add an image

Hi @Bridgett ,

Could you please offer your pbix file and post your desired result if possible? You could upload your file to Dropbox or OneDrive and send the link here that I could have a test for you.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.