This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi
I have a measure as follows
UniqueInteractionId = DISTINCTCOUNT('Interactions'[Interaction: ID])I then have two measures to calculate the monthly runnning total for this year and for last year
MonthlyTotalThisYr =
CALCULATE (
[UniqueInteractionId],
DATESYTD( Dates[Date] )
)MonthlyTotalLastYr =
CALCULATE (
[UniqueInteractionId],
SAMEPERIODLASTYEAR ( Dates[Date] )
)The current year works as expected however the prior year does not
Might anyone have any suggestions as to what i am doing wrong?
Thanks
Solved! Go to Solution.
Hi @Niall ,
The formula SAMEPERIODLASTYEAR takes the same month from the previous year but it does not calculate the YTD. This is why you don't see the correct numbers.
You can try the formula below:
MonthlyTotalLastYr =
CALCULATE (
[UniqueInteractionId],
DATEADD(DATESYTD(Dates[Date]),-1,Year)
)The formula first calculates the YTD, then the function DATEADD subtracts one year from the YTD. Therefore you obtain the YTD of the previous year.
Let me know if this fixes your problem.
Regards,
LC
Interested in Power BI templates? Check out my blog at www.finance-bi.com
Hi @Niall ,
The formula SAMEPERIODLASTYEAR takes the same month from the previous year but it does not calculate the YTD. This is why you don't see the correct numbers.
You can try the formula below:
MonthlyTotalLastYr =
CALCULATE (
[UniqueInteractionId],
DATEADD(DATESYTD(Dates[Date]),-1,Year)
)The formula first calculates the YTD, then the function DATEADD subtracts one year from the YTD. Therefore you obtain the YTD of the previous year.
Let me know if this fixes your problem.
Regards,
LC
Interested in Power BI templates? Check out my blog at www.finance-bi.com
Thanks - works perfectly
Good to hear!
Best of luck for your analysis
LC
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 32 | |
| 26 | |
| 24 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 50 | |
| 31 | |
| 26 | |
| 22 |