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.
Hi suvechha ,
We can create a measure and put it in Filters on this page to meet your requirement.
1. Create a Measure to determine whether the week of today and tomorrow is equal to the week of the date table.
Today =
var _today = FORMAT(TODAY(),"dddd")
var _tomorrow = FORMAT(TODAY()+1,"dddd")
return
IF(
MAX('Date'[DayOfWeek])=_today||MAX('Date'[DayOfWeek])=_tomorrow,1,0)
2. Then select the line chart and put this measure in Filters on this page, configure it as 1.
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.
Hi there,
How to show the report for the max(week) i.e from Monday to Sunday.
Thanks
- v-zhenbw-msft6 years agoCommunity Support
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.