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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

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

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Kudoed Authors