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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Amount from today last year until yesterday current year

Hi,

if today is 28/06/2024
i want the total amount of measure Sold from 28/06/2023 UNTIL 27/06/2024. 
I have table Time and columns Date, Year, Day, Month
I have measure Sold

How i can reach this result?
Thank you so much

1 ACCEPTED SOLUTION
xifeng_L
Super User
Super User

Hi @Anonymous ,

 

You can try below measure.

 

MEASURE =
CALCULATE (
    SUM ( Table[Amount] ),
    TREATAS ( CALENDAR ( EDATE ( TODAY (), -12 ), TODAY () - 1 ), Table[Date] )
)

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

View solution in original post

3 REPLIES 3
bhanu_gautam
Super User
Super User

@Anonymous , You can achieve this using measures

 


Total Sold Last Year to Yesterday =
VAR TodayDate = TODAY()
VAR StartDate = DATE(YEAR(TodayDate) - 1, MONTH(TodayDate), DAY(TodayDate))
VAR EndDate = TodayDate - 1
RETURN
CALCULATE(
[Sold],
FILTER(
'Time',
'Time'[Date] >= StartDate && 'Time'[Date] <= EndDate
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






xifeng_L
Super User
Super User

Hi @Anonymous ,

 

You can try below measure.

 

MEASURE =
CALCULATE (
    SUM ( Table[Amount] ),
    TREATAS ( CALENDAR ( EDATE ( TODAY (), -12 ), TODAY () - 1 ), Table[Date] )
)

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

Anonymous
Not applicable

thank you it works!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.