Forum Discussion
How to show current week data in graph ?
- 6 years ago
Hi suvechha ,
Does the max(week) mean the week of the largest date in WorkOrder table?
If yes, we can create a measure to meet your requirement.
Max week = var _max_date = CALCULATE(MAX(WorkOrder[Date]),ALLSELECTED(WorkOrder)) var _week = CALCULATE(MAX('Date'[Week Number]),FILTER(ALLSELECTED('Date'),'Date'[Date]=_max_date)) return CALCULATE(COUNT(WorkOrder[WORKORDERID]),FILTER('Date','Date'[Year]=YEAR(_max_date)&&'Date'[Week Number]=_week))The sample data has the max date is 2020/8/25, so it displays the 35 week’s Monday and Tuesday.
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
suvechha , if you need Week till date, This Week vs Last week
refer my blog
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
Any Weekday Week - Week calendar of your choice
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482
Hi Amit,
Please kindly help, I can't add this three columns in my Date table :
Week = if('Date'[Week Number]<10,'Date'[Year]*10 & 'Date'[Week Number],'Date'[Year]&'Date'[Week Number])
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
Week name = [Week Start date] & " to "& [Week End date]
My Date Table :