Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello everyone,
I tired to calculate amount percentage comparing to value of the same day on the same week.
For example, if I want to calculate amount for 2020/8/3(Mon), I need to compare it to amount of 2019/8/5(Mon).
Date | Amount |
2020/8/1 | 10 |
2020/8/2 | 20 |
2020/8/3 | 30 |
2020/8/4 | 40 |
2019/8/3 | 15 |
2019/8/4 | 25 |
2019/8/5 | 35 |
I think it's possible to create a Measure with calculate, datadd etc, but I can't get correct value due to incorrect syntax.
How should I write it correctly?
Thanks in advance.
Vladi
Solved! Go to Solution.
@PbiCeo , it will work with a date table marked as date.
example
Week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,Day))
refer Power BI — Day Intelligence
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...
Power BI — WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
@PbiCeo , it will work with a date table marked as date.
example
Week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,Day))
refer Power BI — Day Intelligence
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...
Power BI — WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
Thanks for your advice,
Btw, is there any way to include leap year with the code you provided?
Hi @PbiCeo ,
You cna have a look at this blog.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |