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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply

Week-over-week change $ and %

I have data that captues a "snap shot" of a price each week, example (below).

 

How can I measure week over week change? As a % and $ - I can do some visuals for the trending/direction, but need the ability to capture the detlas in a calculation.

 

A possible alternative is to transform this into monthly data, and then compare months, but I would have to average the costs some (MODE).

 

DATEITEMCOST
20/03/2022 00:00:00123456  2.81
27/03/2022 00:00:00123456  2.81
03/04/2022 00:00:00123456  2.57
10/04/2022 00:00:00123456  2.57
17/04/2022 00:00:00123456  2.57
24/04/2022 00:00:00123456  2.57
01/05/2022 00:00:00123456  2.35
08/05/2022 00:00:00123456  2.25
15/05/2022 00:00:00123456  2.77
22/05/2022 00:00:00123456  2.71
29/05/2022 00:00:00123456  2.71
05/06/2022 00:00:00123456  2.71
12/06/2022 00:00:00123456  2.75
19/06/2022 00:00:00123456  3.08
26/06/2022 00:00:00123456  3.08
03/07/2022 00:00:00123456  3.08
3 REPLIES 3
FreemanZ
Super User
Super User

hi @mattrixdesign2 

you may add a column like:

CostLastWeek=
VAR _weeknum = WEEKNUM([Date])
RETURN
MINX(
   FILTER(
       TableName, 
       TableName[Date]=_weeknum-1
   ), 
TableName[Cost]
)
MAwwad
Solution Sage
Solution Sage

  1. reate a new column for the week-over-week change in cost by using the DIFFERENCE function and setting the second argument to 1 (to indicate a 1-week difference). Syntax : =DIFFERENCE(SUMMARIZE(FILTER(YOUR_TABLE,YOUR_TABLE[DATE] = MAX(YOUR_TABLE[DATE])),YOUR_TABLE[COST]),SUMMARIZE(FILTER(YOUR_TABLE,YOUR_TABLE[DATE] = MAX(YOUR_TABLE[DATE])-1),YOUR_TABLE[COST]),1)

  2. Create a new column for the percentage change by dividing the difference column by the previous week's cost and multiplying by 100. Syntax : =[WEEK OVER WEEK CHANGE] / SUMMARIZE(FILTER(YOUR_TABLE,YOUR_TABLE[DATE] = MAX(YOUR_TABLE[DATE])-1),YOUR_TABLE[COST]) * 100

  3. Create a new column for the dollar change by subtracting the previous week's cost from the current week's cost. Syntax : =SUMMARIZE(FILTER(YOUR_TABLE,YOUR_TABLE[DATE] = MAX(YOUR_TABLE[DATE])),YOUR_TABLE[COST]) - SUMMARIZE(FILTER(YOUR_TABLE,YOUR_TABLE[DATE] = MAX(YOUR_TABLE[DATE])-1),YOUR_TABLE[COST])

Hi - for some reason DIFFERENCE is not a valid function for me, not sure why.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors