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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Onclevini
Regular Visitor

Error - Calculate + sameperiodlastyear

Hi there,

 

Can you please help me with the issue I'm facing. I'm using 2 mesures, one for the sales and the sales last year. I used Calculate + Sameperiodlastyear. For some reasons my table is blank except the total.

Year        Sales      Sales LY
2020         473
2021         802
2022        1874
2023        1757
TOTAL      4906        3149

 

Does anyone has a solution for me? Thank you

#Sameperiodlastyear

1 ACCEPTED SOLUTION

Attached is the basic framework.  

- modify your source data to include a date column

- add a Dates table to your data model

- create the SPLY measure from the Dates date column.

 

lbendlin_0-1692102090572.png

Note that this will not be useful for "Period To Date"  reports. To account for partial periods you need to do additional work.

 

 

 

View solution in original post

4 REPLIES 4
Onclevini
Regular Visitor

Thank you for your answer and sorry for my late reply, I just came back from leave. 

Hereunder you will find the data I'm using

https://we.tl/t-cXXvIrOr6F

 

This is what I've got so far

Year           Sales Sales LY
2020473 
2021802 
20221874 
20231757 
TOTAL4906 

 

And this is what I'm expecting

 

Year           Sales Sales LY
2020473 
2021802473
20221874802
202317571874
TOTAL49063149

 

Thank you for your help

 

Attached is the basic framework.  

- modify your source data to include a date column

- add a Dates table to your data model

- create the SPLY measure from the Dates date column.

 

lbendlin_0-1692102090572.png

Note that this will not be useful for "Period To Date"  reports. To account for partial periods you need to do additional work.

 

 

 

Hi There,

 

You are a super star, thank you.

lbendlin
Super User
Super User

Time Intelligence DAX functions require the use of a contiguous and covering calendar table.

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.