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 everyone,
I am having problems creating a visual to represent an inventory forecast. What I want to see on the visual is a line representing safety stock, maximum, and stock level. I have created a measure called "Stock" based on help from this post: https://community.powerbi.com/t5/Desktop/Cumulative-inventory-Forecast/m-p/1466190#M612159
and have posted the code below:
1208. I want to re-code the measure so that ever day between jan. 26 and june 1, the stock shows as 3,050. Any help would be greatly appreciated!
Solved! Go to Solution.
Hi @jakeudy ,
Try to create a Date dimension table and create relationships between your 'Forecast Table' and the Date table. Then, change your measure like below and replace the date column from 'Forecast Table' with the date column from Date table in your visualizations.
Stock =
VAR _CHANGE =
SUMX (
FILTER (
ALL ( 'Forecast Table' ),
'Forecast Table'[Date] <= MAX ( 'Date'[Date] ) ----------------------------changed
&& 'Forecast Table'[Material] = MAX ( 'Forecast Table'[Material] )
&& 'Forecast Table'[Site] = MAX ( 'Forecast Table'[Site] )
),
'Forecast Table'[Quantity]
)
VAR _Total =
SUMX (
FILTER (
'On Hand Table',
'On Hand Table'[Material] = MAX ( 'Forecast Table'[Material] )
&& 'On Hand Table'[INVENTORYSITEID] = MAX ( 'Forecast Table'[Site] )
),
'On Hand Table'[Physical Inventory]
)
RETURN
_CHANGE + _Total
If this method doesn't work, please share me some sample data, not real data, for test.
Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.
Hi @jakeudy ,
Try to create a Date dimension table and create relationships between your 'Forecast Table' and the Date table. Then, change your measure like below and replace the date column from 'Forecast Table' with the date column from Date table in your visualizations.
Stock =
VAR _CHANGE =
SUMX (
FILTER (
ALL ( 'Forecast Table' ),
'Forecast Table'[Date] <= MAX ( 'Date'[Date] ) ----------------------------changed
&& 'Forecast Table'[Material] = MAX ( 'Forecast Table'[Material] )
&& 'Forecast Table'[Site] = MAX ( 'Forecast Table'[Site] )
),
'Forecast Table'[Quantity]
)
VAR _Total =
SUMX (
FILTER (
'On Hand Table',
'On Hand Table'[Material] = MAX ( 'Forecast Table'[Material] )
&& 'On Hand Table'[INVENTORYSITEID] = MAX ( 'Forecast Table'[Site] )
),
'On Hand Table'[Physical Inventory]
)
RETURN
_CHANGE + _Total
If this method doesn't work, please share me some sample data, not real data, for test.
Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.
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 |
---|---|
108 | |
98 | |
81 | |
65 | |
62 |
User | Count |
---|---|
147 | |
116 | |
104 | |
88 | |
65 |