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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Aravind_Kumar
Frequent Visitor

Compare Weekly vs Monthly

Hi All : I am filtering week based on (Week num) Calculation and based on selected week previous 3 weeks are displayed in the matrix.

So i bring 4 weeks of actual data but want to compare the last week selected vs budget for that month. 

 

Below are 3 different examples of matrix movement. 

How to group or keep budget at month to compare for actuals are weekly ? Thank you for input.

 

Matrix is as below:

Week 4Week 3Week 2Week 1Budget
Monthly
Variance (Budget Monthly vs Week 4)
40038041040042525
     (400 - 425 )
      
      
Week 5Week 4Week 3Week 2Budget
Monthly
Variance (Budget Monthly vs Week 5)
41040038041042515
     (410-425)
      
Week 6Week 5Week 4Week 3Budget
Monthly
Variance (Budget Monthly vs Week 6)
39041040038040010
     (390-400)
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Aravind_Kumar , Try if this month and this week(Based on Rank) Can help

 

Have these new columns in Date Table, Week Rank is Important in Date/Week Table

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format

 

These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

 

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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

v-zhangti
Community Support
Community Support

Hi, @Aravind_Kumar 

 

You can try the following methods.

Slicer = VALUES('Table'[Week])
Measure = 
IF ( SELECTEDVALUE ( 'Table'[Week] ) >= SELECTEDVALUE ( Slicer[Week] ) - 3
        && SELECTEDVALUE ( 'Table'[Week] ) <= SELECTEDVALUE ( Slicer[Week] ),
    1,
    0
)
Variance = 
Var _N1=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Week]=SELECTEDVALUE(Slicer[Week])))
Var _N2=CALCULATE(SUM('Table'[BudgetMonthly]),FILTER(ALL('Table'),[Week]=SELECTEDVALUE(Slicer[Week])))
Return
_N2-_N1
Result = IF(ISINSCOPE('Table'[Week]),SUM('Table'[Value]),[Variance])

vzhangti_0-1673256210618.png

vzhangti_1-1673256231148.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Aravind_Kumar 

 

You can try the following methods.

Slicer = VALUES('Table'[Week])
Measure = 
IF ( SELECTEDVALUE ( 'Table'[Week] ) >= SELECTEDVALUE ( Slicer[Week] ) - 3
        && SELECTEDVALUE ( 'Table'[Week] ) <= SELECTEDVALUE ( Slicer[Week] ),
    1,
    0
)
Variance = 
Var _N1=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Week]=SELECTEDVALUE(Slicer[Week])))
Var _N2=CALCULATE(SUM('Table'[BudgetMonthly]),FILTER(ALL('Table'),[Week]=SELECTEDVALUE(Slicer[Week])))
Return
_N2-_N1
Result = IF(ISINSCOPE('Table'[Week]),SUM('Table'[Value]),[Variance])

vzhangti_0-1673256210618.png

vzhangti_1-1673256231148.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

@Aravind_Kumar , Try if this month and this week(Based on Rank) Can help

 

Have these new columns in Date Table, Week Rank is Important in Date/Week Table

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format

 

These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

 

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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