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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculate difference in values from the current week

Hello

I would like to calculate by formula, the difference in "Calls..." either in values or in %, from last week - the previous one, by category.

For example with this last week (53_20)-(52_20).

NOTE: I have an index that sorts those weeks chronologically.

dmorala2_0-1609844739372.png

Thanks in advance.

2 ACCEPTED SOLUTIONS
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Unfortunately, the picture is too vague to provide valid information.

Based on your description, I have created a test file for your reference. The measure is as follows:

Measure = 
var this_index = MAX('Table'[Index])
var last_week = CALCULATE(
    SUM('Table'[value]),
    FILTER(ALLEXCEPT('Table','Table'[category]),'Table'[Index]=this_index-1))
var this_week = SUM('Table'[value])
return this_week-last_week

V-lianl-msft_0-1610005996203.png

Sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Gracias a los 2,

 

pero solucionado!

 

LastW = CALCULATE(sum('WEEK Skyline'[Calls SK]), FILTER(ALLSELECTED('WEEK Skyline'), 'WEEK Skyline'[INDICE]=max('WEEK Skyline'[INDICE])-1))
ThisW = CALCULATE(sum('WEEK Skyline'[Calls SK]), FILTER(ALLSELECTED('WEEK Skyline'), 'WEEK Skyline'[INDICE]=max('WEEK Skyline'[INDICE])))
 
ThisVSLast = [ThisW] - [LastW]
 
 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Gracias a los 2,

 

pero solucionado!

 

LastW = CALCULATE(sum('WEEK Skyline'[Calls SK]), FILTER(ALLSELECTED('WEEK Skyline'), 'WEEK Skyline'[INDICE]=max('WEEK Skyline'[INDICE])-1))
ThisW = CALCULATE(sum('WEEK Skyline'[Calls SK]), FILTER(ALLSELECTED('WEEK Skyline'), 'WEEK Skyline'[INDICE]=max('WEEK Skyline'[INDICE])))
 
ThisVSLast = [ThisW] - [LastW]
 
 
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Unfortunately, the picture is too vague to provide valid information.

Based on your description, I have created a test file for your reference. The measure is as follows:

Measure = 
var this_index = MAX('Table'[Index])
var last_week = CALCULATE(
    SUM('Table'[value]),
    FILTER(ALLEXCEPT('Table','Table'[category]),'Table'[Index]=this_index-1))
var this_week = SUM('Table'[value])
return this_week-last_week

V-lianl-msft_0-1610005996203.png

Sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , In case you need measure, Create a date or week table (separate) with week rank and use that

new column

Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense)

 

measure
This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

 

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-Last-Week/ba-p/1051123
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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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 Kudoed Authors