Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
PbiCeo
Helper II
Helper II

How to calculate amount percentage comparing to value of the same day of week

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).

DateAmount
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.


Measure = SUM ( 'table'[Amount] ) / CALCULATE (
SUM ( 'table'[Amount] ), FILTER('table',
DATEADD ( 'table'[Date], -364, DAY )))


How should I write it correctly?
Thanks in advance.
Vladi

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@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...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak ,

Thanks for your advice,

Btw, is there any way to include leap year with the code you provided?

harshnathani
Community Champion
Community Champion

Hi @PbiCeo ,

 

You cna have a look at this blog.

 

https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

 

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.