Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a stock projection file, it predicts the stock amount of items in each week considering open orders, usage etc.
I need to find when stock amount of an item turns to positive from negative. In the below example we will have a supply gap of 147 pcs in week 29, however in the following week (week30) because of incoming products we will have an excess of 1604 items. So I need to create a measure which calculates week 30
Thanks
Solved! Go to Solution.
@IEG , One of the Idea I have is to create measure This week vs last week and check
if( [Last Week] >0 && then [This Week] <0 , 1, blank())
For this week vs last week
You need week rank in a separate date/week table
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
and then create measures like
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))
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-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Create a couple of measures like
Negative to Positive =
var currentValue = [Volume]
var prevValue = CALCULATE([Volume], DATEADD('Date'[Date], -7, DAY))
return IF( prevValue < 0 && currentValue > 0, 1)
Week turns positive = FIRSTNONBLANK('Date'[Week no 2], [Negative to Positive])
@IEG , One of the Idea I have is to create measure This week vs last week and check
if( [Last Week] >0 && then [This Week] <0 , 1, blank())
For this week vs last week
You need week rank in a separate date/week table
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
and then create measures like
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))
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-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
79 | |
73 | |
56 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |