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.
Can u please share some sample data . I will help u
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
- Vicentbi9 years agoFrequent Visitor
Welp looks like that did not work.
Please use this link.
https://drive.google.com/open?id=0BybUfI2IKhw7M0NWMlp0bG5VSHc
- Baskar9 years agoResident Rockstar
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.