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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

year over year Sales Calculation not working

I have two tables. One Premium and One Dates. Here is the relationship: PaymentDate(Premium) and Date(Dates), it's a many to one relationship. 

 

jayPBI23_1-1656948666087.png

I'm trying to calculate Year over Year Sales. Here is my formula so far, 

 

Total Sales Last Year = CALCULATE(SUM(Premium[TotalCollected]), SAMEPERIODLASTYEAR(Dates[Date]))
 
The current result so far, 
jayPBI23_2-1656948883595.png

 

What am I missing here? It's throwing back same numbers as the current year. Any help is much appreciated!

 

1 ACCEPTED SOLUTION

Hi,

Thank you for your feedback.

Please kindly advise the below.

- Is the number correct?

- I simply used your calculatd column formula to create a measure. I did not change anything except your formula is for a calculated column and mine is for a measure. If your requirement is not to show the future dates information, please add some conditions into the measure. Please check the attached file that I amended the measure not to show the future date's information. 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

7 REPLIES 7
Jihwan_Kim
Super User
Super User

Hi,

Please try, "assign your Dates Table as date table".

Hover over the mouse on your Dates Table's name, and right click. And then you can find a function called "Make as date table".

 

Set and use date tables in Power BI Desktop - Power BI | Microsoft Docs

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hey!

 

So I did do that. It is marked as date table with "date" field being the date column. 

May I ask what are your columns'  data type?

If possible, please share your pbix file's link here, and then I can try to look into it to come up with a more accurate solution.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

here is a link to the pbix file, https://www.dropbox.com/s/zego0j370awlxoo/YearOVerYearTest.pbix?dl=0

 

I've cleaned the data up so it has only what you need. 

 

Thanks!

Hi,

Thank you for your message and please check the attached file.

I created a measure, instead of calculated column.

Thank you.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

When I open up your file, it looks like its throwing the total collected numbers to future dates:

jayPBI23_0-1657053256218.png

 

Hi,

Thank you for your feedback.

Please kindly advise the below.

- Is the number correct?

- I simply used your calculatd column formula to create a measure. I did not change anything except your formula is for a calculated column and mine is for a measure. If your requirement is not to show the future dates information, please add some conditions into the measure. Please check the attached file that I amended the measure not to show the future date's information. 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.