Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello, I am having some measure which is calculating current - previous year which is showing right now i need a another measure that need to calculate current year - previous previous year (ex: 2023-2021). I tried so many things to to acheive it but i cant can anyone help me this is measure i am using for current - previous year now i need 1 more current - previousprevious year(2023-2021)
@Srinivas3350 You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Also:
hi, @Srinivas3350
use dateadd function which give you flexibility of choose previous two year
like dateadd(yourdatecolumn,-2,year)
Hi @Dangar332 , could you please provde me any example where should i add this function
PYLYYTD = CALCULATE([GBP],DATESBETWEEN(DIM_TIME[Full_Date],DATE(YEAR(TODAY())-1,1,1),EDATE(today(),-12)-1))
in here you can use dateadd function instead of DATESBETWEEN function
Hi @Dangar332
this is the error showing
The last argument must be one of these keywords: DAY, MONTH, QUARTER, or YEAR.
hi, @Srinivas3350
PYLYYTD = CALCULATE([GBP], dateadd('yourtablename'[datecolumnname],-2,year))
PYLYYTD = CALCULATE([GBP], dateadd('yourtablename'[datecolumnname],-2,year))
visit HERE to know more about time intelligence function
this is hsoing full 2021 value for the above formula u gave i need it for ytd
hi, @Srinivas3350
can we modify this to year to date?
means you want sum of date from two year back to today(1/1/2021 to 10/20/2023)
if yes then try below
var a = today()
var b =date(year(today())-2,1,1)
var c = filter('yourdatetable','yourdatetable'[datecolumn]<=a && 'yourdatetable'[datecolumn]>=b )
return
sumx(c,[gbp])/1000
or
if you want data from today to previous two years(10/20/2021 to 10/20/2023)
try below
var a = today()
var b = edate(today()-24)
var c = filter('yourdatetable','yourdatetable'[datecolumn]<=a && 'yourdatetable'[datecolumn]>=b )
return
sumx(c,[gbp])/1000
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly. Appreciate your kudos
this is some how working but complete 2021 figure can we modify this to year to date
@Srinivas3350 What is the code for the GBP measure?
Hi @Greg_Deckler
it is just GBP column divided by 1000
@Srinivas3350 Maybe:
PYLYYTD =
VAR __MinDate = DATE(YEAR(TODAY())-1,1,1)
VAR __MaxDate = EDATE(TODAY(),-12)-1
VAR __Table = FILTER( 'Table', [Date] <= __MaxDate && [Date] >= __MinDate)
VAR __Result = SUMX(__Table, [GBP]) / 1000
RETURN
__Result
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.