Forum Discussion
Week over week per Produkt
Dear PowerBI Community,
I have an issue and dont know how to solve it. Perhaps someone here has an idea.
The challenge is the following I want to calculate the week over week performance across all products but only if in both weeks products have been sold.
Wished result would be:
| Product | Previous Week | Relevant Current Week |
| Product A | ||
| Product B | 105 | 110 |
| Product C | ||
| Product D | 95 | 95 |
| Total | 200 | 205 |
So check if there is a value in the prevous week if yes then select current week value else blank.
Also the other way around check if there is a previous week value and a current week value if true then show previus week value if there is no value for current week then leave relevant previous week value blank.
Looking forward to get some ideas
2 Replies
- amitchandakSuper User
BhagatRansi , Does you raw data have YYYYWW (year week) or date, Then you can use date/year week table and week rank
new columns
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW formatmeasures
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))diff % = divide([This week] - [Last Week], [Last Week])
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s - BhagatRansiFrequent Visitor
Hi Amit,
unfortunately that solution is not sufficient. That brings me back to where I was as you can see:
I would need it like decribed per product and only select values if in both week there is a measure.
Is that possible?
Thanks for the support!
BR, Bhagat