Forum Discussion
Table with last 4 weeks data
- 6 years ago
Hi Anonymous ,
We can use two ways to meet your requirement.
1. Create a calculate column first to get the week number.
week = RIGHT('Table'[year&week],LEN('Table'[year&week])-FIND("-",'Table'[year&week],1,1))Then we can create a measure based on [week].
Measure = var last_week = MAXX(ALLSELECTED('Table'),'Table'[week]) var Last_four_week = last_week-4 return CALCULATE(SUM('Table'[values]),FILTER('Table','Table'[week]>Last_four_week && 'Table'[week]<=last_week))And we can put the [year & week] and [Measure] in a table visual.
2. We can use Filters on this visual to get the result.
Also we need the week number column.
Then we create a table and configure the [year & week]’s filter and put the [week] on By value.
The result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.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.
I'm sorry Anonymous but maybe i did miss something....i don't have any column or measure in my date table named sort.
Can you help?
Sorry, I am not sure if that is even necessary. But my calendar date column is "calendardate[date]" and then I have another column called "Sort" which is just,