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 - many thanks for your reply. I've added an extra tab to the sample data I sent. Link below. I basically want to extract the key information (perhaps even rank the modalities i.e. CT performed best, followed by MRI, then US - for example). The example I've given is for patients waiting over 14 days but I also need to show those who were seen within 7 days. Obviously I want to see more in this timeframe than waiting over 14 days!
I'd like to show this as a card, with text, or happy just to show in a ranked table with the respective changes detailed in this table.
Many thanks in advance!