Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 17 | |
| 9 | |
| 8 | |
| 7 |