Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm having trouble writing a measure that calculates last year's value. Below is an image showing what I mean:
I need the "Wolumen YA" measure to calculate growth in the current year relative to last year. For reasons I don't understand, the measure calculates the value for its year. Below is the measure:
Wolumen YA = CALCULATE([Wolumen], SAMEPERIODLASTYEAR(Dates[Date]))
Maybe someone has encountered a similar problem and will be able to explain what's wrong here.
Solved! Go to Solution.
Hi @Anonymous
Thanks for the reply from Greg_Deckler and HotChilli .
@Anonymous , the following test is for your reference.
My sample:
Create several measures as follow
This year = SUM('Table'[Value])
The measure was created just to restore your scenario, as I don't know the creation logic of your Wolumen.
Measure =
VAR _year = MAX([Year])
VAR _month = MAX([Month])
RETURN
CALCULATE([This year], FILTER(ALL('Table'), [Year] = _year - 1 && [Month] = _month))
Measure 1 = SUMX(VALUES('Table'[Month]), [Measure])
Last year = SUMX(VALUES('Table'[Year]), [Measure 1])
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Thanks for the reply from Greg_Deckler and HotChilli .
@Anonymous , the following test is for your reference.
My sample:
Create several measures as follow
This year = SUM('Table'[Value])
The measure was created just to restore your scenario, as I don't know the creation logic of your Wolumen.
Measure =
VAR _year = MAX([Year])
VAR _month = MAX([Month])
RETURN
CALCULATE([This year], FILTER(ALL('Table'), [Year] = _year - 1 && [Month] = _month))
Measure 1 = SUMX(VALUES('Table'[Month]), [Measure])
Last year = SUMX(VALUES('Table'[Year]), [Measure 1])
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
What's in the matrix visual? Which tables are used in the model? What are the relationships?
What is the measure [Wolumen]?
@Anonymous You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also this: (1) Better Year Over Year Change - Microsoft Fabric Community
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-TITHW/m-p/434008
Also, this video demonstrates numerous different ways to calculate time intelligence measures:
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |