Forum Discussion
Current Week Value based on date field
- 4 years ago
Hi, Creative_tree88
Try to create measures as following:Result:
Please refer to the attachment below for details.
Note: Only results older than 14 days are included in the attachment, you can switch measures to get results younger than 7 days.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Creative_tree88 , expected output is not very clear. need example.
For WOW
new columns in date table
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
measures needed ]
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))
amitchandak and v-angzheng-msft
Apologies - I thought I'd made this test data available. Please find link below, with expected result and a few words regarding what I'd like it to 'say' ideally?
- v-angzheng-msft4 years agoCommunity Support
Hi, Creative_tree88
Try to create measures as following:Result:
Please refer to the attachment below for details.
Note: Only results older than 14 days are included in the attachment, you can switch measures to get results younger than 7 days.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Creative_tree884 years agoHelper V
v-angzheng-msft - many thanks for your help with this. I'll study the attachment and your suggested technique and hopefully it'll work exactly as planned! Best regards