cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
po Member
Member

Previous weeks data

Hi,

 

We wish to get the last weeks of sales for previous week
 
Data in format
 
Customner Number, week ending date, %age sold
 
e.g 
 
10, 05/01/2019, 72%
10, 12/01/2019, 73%
10,19/01/2019, 75%
5, 12/01/2019, 90%
 
Wish to show  an additional column for each row wish the previous weeks percentage and then use this to capture upward or downward trend.
 
Some customers do not have all weeks and wish to ensure that all rows still show even if no previous sales.
 
was hoping belwo would work but somestimes when apply filter to e.g customer don;t see any rwos.
 
How can we best achieve this?
 
CALCULATE(SUM('Sales'[Sales %age]),FILTER(ALL('Sales'[Week Ending]),'Store Summary'[Week Ending]=MAX('Sales'[Week Ending])-7))
 
Thanks
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Previous weeks data

You likely need to use EARLIER. And probably WEEKNUM as well. See my article on Mean Time Before Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


2 REPLIES 2
Super User
Super User

Re: Previous weeks data

You likely need to use EARLIER. And probably WEEKNUM as well. See my article on Mean Time Before Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


po Member
Member

Re: Previous weeks data

Thanks for reply.