Forum Discussion
Prior Week Of Sales - easy way
- Anonymous2 years ago
Your solution is great Shravan133 .
Hi ebrownretail ,
If you are trying to share what you are doing, you can reply to yourself and accept it as a solution to help other members find it faster. Here I have another idea in mind, and I would like to share it for reference.1.Create simple data:
The relationship between them is:
2.Create a measure. Checks if the selected value of POS Sales in the All Sales History table is not blank. Applies a filter to select records where the Fiscal Week in the Dates table is equal to ‘_current_week – 1’, effectively getting the sales data for the prior week.
Prior Week Sales = VAR _current_week = SELECTEDVALUE(Dates[Fiscal Week]) RETURN IF(SELECTEDVALUE('All Sales History'[POS Sales])<>BLANK(),CALCULATE(SUM('All Sales History'[POS Sales]),ALL('All Sales History'),'Dates'[Fiscal Week]=_current_week-1))3.The final result is as follows:
Best Regards,
Zhu
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Your solution is great Shravan133 .
Hi ebrownretail ,
If you are trying to share what you are doing, you can reply to yourself and accept it as a solution to help other members find it faster. Here I have another idea in mind, and I would like to share it for reference.
1.Create simple data:
The relationship between them is:
2.Create a measure. Checks if the selected value of POS Sales in the All Sales History table is not blank. Applies a filter to select records where the Fiscal Week in the Dates table is equal to ‘_current_week – 1’, effectively getting the sales data for the prior week.
Prior Week Sales =
VAR _current_week = SELECTEDVALUE(Dates[Fiscal Week])
RETURN IF(SELECTEDVALUE('All Sales History'[POS Sales])<>BLANK(),CALCULATE(SUM('All Sales History'[POS Sales]),ALL('All Sales History'),'Dates'[Fiscal Week]=_current_week-1))
3.The final result is as follows:
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!