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.
I'm trying to calculate year-over-year % change. I've created three measures to do this: Total, PY Total2, % Change.
The formulas I've used are as follows:
1. Total:
This depends on how your dataset is, but you could do something like this
PY Total2 = VAR cYear = IF(HASONEVALUE(data[Posting Year]),VALUES(data[Posting Year])) RETURN IF( NOT(ISBLANK(cYear)), CALCULATE( [Total], data[Posting Year] = (cYear - 1), all(data) ) )
I would guess that in the Total 2018 you have the full year and in the PY Total (2019), you only have Jan-Sep 2018 since within 2019 you do not have dates for the full year. Hence, sameperiodlastyear will shift the dates from Jan-Sep 2019 to Jan-Sep 2018 and that is what you are seeing in PY Total for 2019.
Regards,
Kristjan
Thanks for your response! Do you know how I can fix this formula to be accurate if we don't have all of our 2019 date yet?
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
That being said, 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-TIT...
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |