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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
dwel0120
Helper III
Helper III

Previous Week Change Rate

I'm trying to do a previous week to current week rate. I have these columns: WEEKOF, WKNM (week number), WITHDRAWALRATE, WEEKRATE, and YEAR. I also have a measure WITHDRAWALRATEMEASURE. 

 

I have come up with a formula but it is not giving me the correct rate. 

 
PreviousWeekChange =
VAR PreviousWeek =
CALCULATE (
'TABLE1'[WITHDRAWALRateMeasure],
FILTER (
ALL (TABLE1),
'TABLE1'[WKNM]
= MAX ( 'TABLE1'[WKNM] ) -1
)
)
RETURN
IF (
MAX('TABLE1'[WKNM]) =1,
BLANK(),
DIVIDE ( ( TABLE1[WITHDRAWALRateMeasure] - PREVIOUSWEEK), PREVIOUSWEEK))
3 REPLIES 3
Anonymous
Not applicable

Instead of using YearWeekNum, I suggest to have a column "WeekStartDate" . It will make your life easier for across the years as you would have to simply subtract 7 days to get the Previous week.

amitchandak
Super User
Super User

@dwel0120 , best way to work with week is to have separate week table, Prefer to have year week Table, with Rank on Year Week (YYYYWW)

 

 

example

if WITHDRAWALRateMeasure is the measure, you do not need table name, else use sum(Table[WITHDRAWALRateMeasure])

 

PreviousWeekChange =
VAR PreviousWeek =
CALCULATE (
[WITHDRAWALRateMeasure],
FILTER (
ALL (WEEK),
'WEEK'[WKNM]
= MAX ( 'WEEK'[WKNM] ) -1
)
)
RETURN
IF (
MAX('WEEK'[WKNM]) =1,
BLANK(),
DIVIDE ( ( [WITHDRAWALRateMeasure] - PREVIOUSWEEK), PREVIOUSWEEK))

 

 

Also, refer to my blog how to deal week with help from rank if needed

 

Power BI — Week on Week and 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...
https://www.youtube.com/watch?v=pnAesWxYgJ8

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 That didn't work for me. I can't figure out what is happening. Screenshot of table below and formula. I also created a week table like the one you provided a link to but that did now work either. I even created the relationship between the TABLE1 and the Week Table. 

 

PreviousWeekChange =
VAR PreviousWeek =
CALCULATE (
[WITHDRAWALRateMeasure],
FILTER (
ALL ('TABLE1'),
'TABLE1'[WKNM]
= MAX ( 'TABLE1'[WKNM] ) -1
)
)
RETURN
IF (
MAX('TABLE1'[WKNM]) =1,
BLANK(),
DIVIDE ( ( [WITHDRAWALRateMeasure] - PREVIOUSWEEK), PREVIOUSWEEK))
 

dwel0120_0-1627307966460.png

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.