Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi, Im having a problem with the calculation made by SAMEPERIODLASTYEAR, but this problem does not happens using it twice to get the last last year calculation:
As you can see, the LY Revenue total calculation is absolutely wrong and I can not get why.
Thanks in advance
@aalamos , Try trailing year measure
LY Revenue =
CALCULATE(SUM('Sales'[total]), dateadd('Calendar'[Date],-1, year))
LLY Revenue =
CALCULATE(SUM('Sales'[total]), dateadd('Calendar'[Date],-2, year))
or try
LLY Revenue = CALCULATE(SUM('Sales'[total]), SAMEPERIODLASTYEAR(dateadd('Calendar'[Date],-1,year)))
Hi,
I tried your solution but I have the following issue that is the same using SAMEPERIODLASTYEAR:
As you can see, if I use an advanced filter on the date slicer using date is "on or after" 01-01-2021 the calculation is correctly done:
BUT, if I move the slicer to any other data range and then I move it back to the same range (01-01-2021 / 11-07-2021) the sum calculation is messed up again:
Thanks in advance for your time
Hi, @aalamos
From your current formula, I did not find any error, maybe you need to manually filter the year in table visual filter pane.
If I misunderstood, please explain it in more detail and share your sample files for further research.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
| User | Count |
|---|---|
| 23 | |
| 19 | |
| 18 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 60 | |
| 52 | |
| 47 | |
| 40 | |
| 38 |