Forum Discussion
Current Week versus Last Week Totals as a Bar Chart
- Anonymous4 years ago
Hi Anonymous ~
I created a sample:
Please try these measures:
Current Week = var __Today = TODAY() var __WeekStartDate = __Today-WEEKDAY(__Today,1)+1 var __WeekEndDate = __WeekStartDate+6 return CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),__WeekStartDate<='Table'[Closed] && __WeekEndDate>='Table'[Closed]))Last Week = var __Today = TODAY() var __WeekStartDate = __Today-WEEKDAY(__Today,1)-6 var __WeekEndDate = __WeekStartDate+6 return CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),__WeekStartDate<='Table'[Closed] && __WeekEndDate>='Table'[Closed]))create a table:
create a measure:
Measure Value = SWITCH( SELECTEDVALUE('Table1'[order]), 1,[Current Week], 2,[Last Week] )Finally create a bar chart:
Hope it helps!
Best regards,
Community Support Team Gao
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hope this helps as I couldn't get the export form my desktop.
Hi~ Anonymous
Please check the data type of the Order column.If it is in Text format, change it to Whole number format.Then check the bar chart.
If the problem is not solved, please provide the error information, it will help me to find the problem, thank you very much!
Best regards,
Community Support Team Gao
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
Here is the information you requested.
- Anonymous4 years agoNot applicable
Hi~ Anonymous
The problem is because of the data type of the data.
Please contrast the data type of the measures and columns. Hope it helps.
This is my Test FileBest regards,
Community Support Team Gao
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.