Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
I have a table like this:
| Contract | Date | Revenue |
| 1 | 1/08/2025 | 100 |
| 2 | 1/05/2024 | 20 |
| 2 | 1/05/2025 | 80 |
| 1 | 1/04/2024 | 50 |
| 3 | 1/04/2025 | 50 |
I want to calculate the difference between this year (2025) and last year (2024), using my filters. For example only for the period jan-july
Result should look like this (if filter month = 1 - 7)
| Contract | YoY |
| 1 | -50 |
| 2 | 60 |
| 3 | 50 |
Please need help with DAX Measure. thanks.
Solved! Go to Solution.
Hi @Ptolemaida , Thank you for reaching out to the Microsoft Community Forum.
We find the answer shared by @Cookistador is appropriate. Can you please confirm if the solution worked for you. It will help others with similar issues find the answer easily.
Thank you @Cookistador for your valuable response.
Hi @Ptolemaida , Thank you for reaching out to the Microsoft Community Forum.
We find the answer shared by @Cookistador is appropriate. Can you please confirm if the solution worked for you. It will help others with similar issues find the answer easily.
Thank you @Cookistador for your valuable response.
You can do this easily with a YoY (Year-over-Year) DAX measure like this:
Important notes:
Make sure you have a Date table properly marked as a date table.
When you filter (for example, months 1–7), the measure will respect that automatically.
Place Contract on rows and this YoY Revenue measure on values
Hi @Ptolemaida, try this measure
Contract YoY =
VAR CurrentYear =
MAXX (
ALLSELECTED (Contracts[ContractDate]),
YEAR (Contracts[ContractDate])
)
VAR ThisYearRevenue =
CALCULATE (
sum(Contracts[Revenue]),
FILTER (
ALLSELECTED (Contracts[ContractDate]),
YEAR (Contracts[ContractDate]) = CurrentYear
)
)
VAR LastYearRevenue =
CALCULATE (
sum(Contracts[Revenue]),
FILTER (
ALLSELECTED (Contracts[ContractDate]),
YEAR (Contracts[ContractDate]) = CurrentYear - 1
)
)
RETURN
ThisYearRevenue - LastYearRevenue
Hi @Ptolemaida
The first step is to create a date table: to do that, create a calculate table with calendarauto()
You link your date table and the table in which you have the revenue and then, you just have to create the following measure:
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 37 | |
| 30 | |
| 26 |