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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.