Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello,
I'm wondering how to force SAMEPERIODLASTYEAR() not to sum figures from the last available quarter taking into account that the quarter is not complete yet.
The example is below. The function correctly takes figures from January and February 2013, shows them near January and February 2014, but when it comes to the quarter result, instead of seeing figures from Q1 2013 (2,656,502.36) I got a simple sum of January&February 2014 which equals 1,618,669.75.
How to get 2,656,502.36 in the second column instead of 1,618,669.75?
Answers to the most typical questions:
1. I'm using a table that is marked as Date Table.
2. All connections between tables are established.
3. There are no dates after the 4th of February in both fact and dimension tables.
Solved! Go to Solution.
It turned out to be much easier. The date table should contain all dates related to the current year, even if the year hasn't ended yet. Then the calculations are correct.
It turned out to be much easier. The date table should contain all dates related to the current year, even if the year hasn't ended yet. Then the calculations are correct.
Hello @amitchandak
I'm currently using one SAMEPERIODLASTYEAR() formula that is applied to all time periods:
@AlinaP92 , You can use last year same qtr in sub total using isinscope
If(isinscope(date[Qtr]) && not(isinscope(Date[Month] )) , [Last year Qtr sales], [Sales Sameperiod last year ])
example
Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))
Last year same QTR full Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER(dateadd('Date'[Date],-1,Year))))
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
83 | |
82 | |
71 | |
49 |
User | Count |
---|---|
143 | |
129 | |
108 | |
63 | |
55 |