- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to get Last Year YTD
Hi Everyone,
Could you please help me modify this formula to get Last Year YTD? Thank you very much in advnace!
VAR __MaxDate = MAX('Dates'[Date])
RETURN
Calculate(SUM(OrderLine[Booking USD]), YEAR('OrderLine'[Open_Date]) = YEAR(__MaxDate), MONTH('OrderLine'[Open_Date]) <= MONTH(__MaxDate ))
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @FR14 ,
You can update your measure.
Measure=
VAR __MaxDate = MAX('Dates'[Date])
RETURN
CALCULATE(
SUM(OrderLine[Booking USD]),
DATESYTD(DATEADD(__MaxDate, -1, YEAR))
)
Or:
VAR __MaxDate = MAX('Dates'[Date])
VAR __StartOfLastYear = DATE(YEAR(__MaxDate) - 1, 1, 1)
RETURN
CALCULATE(
SUM(OrderLine[Booking USD]),
OrderLine[Open_Date] >= __StartOfLastYear,
OrderLine[Open_Date] <= __MaxDate
)
You can refer to the following posts that may be helpful to you:
YTD last year DAX - Microsoft Fabric Community
How to Calculate Year to Date and Prior YTD in Power BI (popautomation.com)
Get the YTD of the same period last year - Kasper On BI
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @FR14 ,
You can update your measure.
Measure=
VAR __MaxDate = MAX('Dates'[Date])
RETURN
CALCULATE(
SUM(OrderLine[Booking USD]),
DATESYTD(DATEADD(__MaxDate, -1, YEAR))
)
Or:
VAR __MaxDate = MAX('Dates'[Date])
VAR __StartOfLastYear = DATE(YEAR(__MaxDate) - 1, 1, 1)
RETURN
CALCULATE(
SUM(OrderLine[Booking USD]),
OrderLine[Open_Date] >= __StartOfLastYear,
OrderLine[Open_Date] <= __MaxDate
)
You can refer to the following posts that may be helpful to you:
YTD last year DAX - Microsoft Fabric Community
How to Calculate Year to Date and Prior YTD in Power BI (popautomation.com)
Get the YTD of the same period last year - Kasper On BI
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
09-05-2024 12:38 PM | |||
11-20-2024 01:52 AM | |||
01-17-2025 02:55 PM | |||
10-18-2024 04:49 AM | |||
04-24-2024 10:22 AM |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
9 |