Forum Discussion
Getting Value Sum from previous week
- 9 years ago
Sorry Mistake is my side.
Try this
Pre Sales =
var End_Date = MIN('Week Sales'[StartOfWeek]) -1
var Start_Date = End_Date - 6
return
CALCULATE(SUM('Week Sales'[Sales]),DATESBETWEEN('Week Sales'[Date],Start_Date,End_Date),ALLSELECTED('Week Sales'[StartOfWeek]))Small Change in your already existing formula .
Change ALLExcpet into ALLSelected, It should work
If not let me know dude.
Strange I do not see where I can attach a file.
I'm attaching it as a photo for now.
Do not know if it works.
This is not the data I was using orgnially but structure should be the same
Do u have Continuos date in your Table ?
- Vicentbi9 years agoFrequent Visitor
I believe so, the Date table is made by Power bi with calendar funcation.
- Baskar9 years agoResident Rockstar
Sorry Mistake is my side.
Try this
Pre Sales =
var End_Date = MIN('Week Sales'[StartOfWeek]) -1
var Start_Date = End_Date - 6
return
CALCULATE(SUM('Week Sales'[Sales]),DATESBETWEEN('Week Sales'[Date],Start_Date,End_Date),ALLSELECTED('Week Sales'[StartOfWeek]))Small Change in your already existing formula .
Change ALLExcpet into ALLSelected, It should work
If not let me know dude.
- Baskar9 years agoResident Rockstar
ALLExcpet also work .
Try this Replace Date in Allexcpet with Dimension name.
I hope this will also works for u :-)