Forum Discussion
Compare Last Week's Sum and Past Two Week's Sum Average
Hi Shalini,
If you try the following formula for RunTot , it should work
RunTot = CALCULATE (
SUM ( 'Data'[Qty]),
FILTER ( ALLEXCEPT( Data,Data[Category]), Data[WeekNum] >= MAX ( 'Data'[WeekNum] ) - 4 &&Data[WeekNum] <= MAX ( 'Data'[WeekNum] ))
)
Replace Data with your table name.
When you put Category in the table output ensure the Category column is sorted in the ascending order of category.
Let me know if you face any issues.
If it works please accept this as a solution and also give KUDOS.
Cheers
CheenuSing
thank you CheenuSing!! That worked !!!
:)
- shalini9 years agoFrequent Visitor
hi CheenuSing,
Just a quick check.. can i use the same logic to add a formula into "Add column" instead of a measure? if so what will it be ?
- Anonymous9 years agoNot applicable
- shalini9 years agoFrequent Visitor
and also is there a way to combine tables (Table1+Table2+Table3) that you see in the attached screen shot into Table 4, cause i have calculated measues on these and i have filtered the weeks that i need accordengly and now i just want to combine these into 1 table in the visualization page. and this new table 4 should allow me to add more measures.
is there a way to do this?
ideally i need to achive as below:
Part Avaialble Qty Last 4 Wks Shipment Last 4 Wks Avg Shipment 6 Wks DDS 6 Wks Avg DDS Part a 39,636 23,360 5,840 43,003 7,167 Part b 0 0 0 0 0 Part c 53,929 19,674 4,919 37,230 6,205 Part d 0 0 0 0 0 is this the correct way or is there a better way to do this?
Thanks