User Profile
jakeudy
Helper I
Joined 6 years ago
User Widgets
Contributions
Grouping rows of data so that each group sums to a specific quantity
I have a table of data that I need to group in a way that allows me to create a production schedule. Below is the current structure of the table: Sales Order Ship No Later Than Quantity SO-24-01767 05/24/2024 1 SO-24-01775 05/24/2024 1 SO-24-01789 06/07/2024 1 SO-24-01792 06/21/2024 4 SO-24-01795 06/28/2024 1 SO-24-01799 07/12/2024 1 SO-24-01823 07/12/2024 1 SO-24-01831 07/16/2024 3 SO-24-01833 07/16/2024 1 SO-24-01840 07/16/2024 1 SO-24-01842 07/22/2024 1 SO-24-01859 07/22/2024 2 SO-24-01860 07/26/2024 1 SO-24-01866 07/26/2024 1 SO-24-01869 08/09/2024 3 SO-24-01874 08/09/2024 1 SO-24-01878 08/23/2024 1 SO-24-01882 08/23/2024 4 SO-24-01890 08/30/2024 1 What I need to do is set up a recursive calculation to group these rows such that each group adds up to a quantity of 3, and have it sum in chronological order based on the ship no later date. I need each of the groups to be defined by a week number, starting with the current week. Below is my expected output. Sales Order Week 24, 2024 Week 25, 2024 Week 26, 2024 Week 27, 2024 Week 28, 2024 Week 29, 2024 Week 30, 2024 Week 31, 2024 Week 32, 2024 Week 33, 2024 SO-24-01767 1 SO-24-01775 1 SO-24-01789 1 SO-24-01792 1 SO-24-01792 1 SO-24-01792 1 SO-24-01792 1 SO-24-01795 1 SO-24-01799 1 SO-24-01823 1 SO-24-01831 1 SO-24-01831 1 SO-24-01831 1 SO-24-01833 1 SO-24-01840 1 SO-24-01842 1 SO-24-01859 1 SO-24-01859 1 SO-24-01860 1 SO-24-01866 1 SO-24-01869 1 SO-24-01869 1 SO-24-01869 1 SO-24-01874 1 SO-24-01878 1 SO-24-01882 1 SO-24-01882 1 SO-24-01882 1 SO-24-01882 1 SO-24-01890 1 Is this possible to accomplish in Power Query? I have tried several different approaches and none of the things I have tried have produced the desired output. The orders that have a greater quantity than 1 that have to be split across multiple weeks has presented a challenge. Any help would be much appreciated.Solved858Views0likes2CommentsPrevisión de inventario
Hola a todos, Tengo problemas para crear un objeto visual para representar una previsión de inventario. Lo que quiero ver en el objeto visual es una línea que represente el stock de seguridad, el máximo y el nivel de stock. He creado una medida llamada "Stock" basada en la ayuda de este post: https://community.powerbi.com/t5/Desktop/Cumulative-inventory-Forecast/m-p/1466190#M612159 y han publicado el siguiente código: Stock ? DONDE _CHANGE ? SUMX ( FILTRO ( ALL ( 'Tabla de previsión'), 'Tabla de previsión'[Fecha]. [Fecha] <- MAX ( 'Tabla de previsión'[Fecha].[ Fecha] ) && 'Tabla de previsión'[Material] - MAX ( 'Tabla de previsión'[Material] ) && 'Tabla de previsión'[Sitio] - MAX ( 'Tabla de previsión'[Sitio] ) ), 'Tabla de previsión'[Cantidad] ) VAR _Total de VAR ? SUMX ( FILTRO ( 'En la mesa de la mano', 'On Hand Table'[Material] á MAX ( 'Tabla de previsión'[Material] ) && 'On Hand Table'[INVENTORYSITEID] á MAX ( 'Tabla de previsión'[Sitio] ) ), 'On Hand Table'[Inventario físico] ) devolución _CHANGE + _Total El problema con este código es que quiero que calcule el stock en función del cálculo del día anterior. Esta medida no calcula el stock a diario, sólo calcula los días en los que el stock está cambiando. En este momento, mi visual se ve así: El resultado deseado es que la línea "Stock" permanezca plana hasta que se produce un cambio en el nivel de stock. Así que en lugar de tener la línea disminuyendo gradualmente de enero-junio de 2021, la línea debe permanecer plana hasta junio cuando se prevé que se produzca una venta. El 26 de enero de 2021, el valor de las acciones es de 3.050 y no hay otros valores para las acciones que aparecen hasta el 1 de junio de 2021, cuando se 1208. Quiero volver a codificar la medida para que cualquier día entre Jan. 26 y 1 de junio, las acciones se muestran como 3.050. Cualquier ayuda sería muy apreciada!Solved454Views0likes1CommentInventory forecasting
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: Stock = VAR _CHANGE = SUMX ( FILTER ( ALL ( 'Forecast Table' ), 'Forecast Table'[Date].[Date] <= MAX ( 'Forecast Table'[Date].[Date] ) && '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 The problem with this code is that I want it to calculate the stock based on the previous day's calculation. This measure does not calculate stock on a daily basis, it only calculates on days where the stock is changing. Right now, my visual looks like this: The desired outcome is to have the "Stock" line remain flat until a change in stock level happens. So rather than having the line gradually decreasing from jan-june 2021, the line should stay flat until june when a sale is forecasted to occur. On January 26, 2021, the value for stock is 3,050 and there are no other values for stock showing up until june 1, 2021 when it drops to 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!Solved2.5KViews0likes1CommentCambio dinámico de la previsión de inventario
Tengo 3 tablas separadas con las que estoy trabajando: Inventario actual, Pedidos de compra abiertos y Pedidos de ventas abiertos. En las tablas Pedidos de compra y Pedidos de ventas hay un campo Fecha de entrega esperada (para compras) y una fecha de envío esperada (para ventas). Tengo una tabla Calendar a la que he vinculado ambas tablas, usando sus respectivos campos de fecha. En las 3 tablas tengo un campo de sitio de inventario y un campo de número de artículo. Básicamente quiero crear un gráfico de líneas con tiempo en el eje (por semana), número de artículo como leyenda y nivel de inventario como valor, con una segmentación de datos en el lado que me permite elegir qué sitio de inventario mirar. Me gustaría que el eje de mi gráfico de líneas comience 1 semana antes de la fecha más temprana en mis pedidos de compra abiertos y tablas de pedidos de ventas abiertos. Por ejemplo, si la fecha más temprana en mis pedidos de compra abiertos fue 7/6/2020 y la fecha más temprana en los pedidos de ventas abiertos fue 7/22/2020, me gustaría que mi eje comenzara el 6/29/2020 (una semana antes del 7/6/2020). Entonces tendré que configurar mi cálculo para el nivel de inventario. La idea es que quiero tomar el inventario actual a mano, restar la cantidad de pedidos de ventas abiertos y agregar la cantidad de pedidos de compra abiertos. Por ejemplo, supongamos que tengo 30 unidades del artículo 123 actualmente en stock, un pedido de ventas abierto para 20 unidades para ese artículo que se espera que se envíe el 8/4/2020, y un pedido de compra abierto para 40 unidades de ese artículo programado para llegar 8/18. Me gustaría que mi línea que representa el inventario permanezca igual hasta el 8/4/2020, entonces me gustaría que se sumerja en 20 unidades. Luego, 2 semanas más tarde me gustaría ver que saltar por 40 unidades. Así que básicamente para calcular el inventario proyectado semana a semana, la fórmula tendría que hacer referencia al número de la semana anterior y agregar / restar en función de lo que los pedidos de compra / venta abiertos hay (si los hay) en esa semana. ¿Es posible hacerlo en Power BI? Tengo algo similar a esto configurado en Excel, pero tengo que volcar manualmente nuevos datos en él todo el tiempo para mantenerlos precisos. Cualquier ayuda sería apreciada!615Views0likes2CommentsDynamically changing inventory forecast
I have 3 separate tables that I am working with: Current Inventory, Open Purchase Orders, and Open Sales Orders. In the Purchase Orders and Sales Orders tables there is an Expected Delivery date field (for purchases) and expected ship date field (for sales). I have a Calendar table that I have linked both of these tables to, using their respective date fields. In all 3 tables I have an inventory site field and an item number field. Basically I want to build a line chart with time on the axis (by week), item number as the legend, and inventory level as the value, with a slicer on the side that allows me to choose which inventory site to look at. I would want the axis of my line chart to start 1 week prior to whatever the earliest date in my open purchase orders and open sales orders tables is. For example, if the earliest date in my open purchase orders was 7/6/2020 and the earliest date in open sales orders was 7/22/2020, I would want my axis to start on 6/29/2020 (one week before 7/6/2020). Then I will need to set up my calculation for inventory level. The idea is that I want to take the current inventory on hand, subtract the quantity from open sales orders, and add the quantity from open purchase orders. For example, let's say I have 30 units of item 123 currently in stock, an open sales order for 20 units for that item expected to ship on 8/4/2020, and an open purchase order for 40 units of that item scheduled to arrive 8/18. I would want my line representing inventory to stay the same up until 8/4/2020, then I would want it to dip by 20 units. Then 2 weeks later I would want to see it jump up by 40 units. So basically to calculate the projected inventory week by week, the formula would have to reference the previous week's number and add/subtract based on what open purchase/sales orders there are (if any) in that week. Is this even possible to do in Power BI? I have something similar to this set up in Excel, but I have to manually dump new data into it all the time to keep it accurate. Any help would be appreciated!1.7KViews0likes2CommentsRe: Clasificación de un pedido en función de varios resultados dentro de la orden
Este tipo de trabajo, sin embargo, no es exactamente lo que estoy buscando. Cuando veo los datos en formato de tabla, funciona correctamente. Sin embargo, cuando intento verlo en un formato diferente, como una tarjeta o un gráfico de columnas, estropea el cálculo. Lo ideal sería utilizar esta medida para ver qué porcentaje de pedidos están a tiempo y qué porcentaje llegan tarde. Así que me gustaría crear un gráfico de columnas 100% apilado con esta medida como leyenda, y el recuento (distinto) de órdenes como valor. ¿Hay algo que pueda agregar a la fórmula para acomodar esto? ¿Necesito cambiarlo de una medida a una columna? He notado que el uso de una medida en la leyenda de un objeto visual a menudo no funciona. ¡Gracias por tu ayuda! @amitchandak404Views0likes2CommentsRe: Classifying an order based on multiple results within the order
This sort of worked, however its not quite what I'm looking for. When I view the data in table format it works correctly. However, when I try to view it in a different format such as a card or a column chart, it messes up the calculation. Ideally I would like to use this measure to see what percentage of orders are on time and what percentage are late. So I'd like to build a 100% stacked column chart with this measure as the legend, and the count (distinct) of orders as the value. Is there something I can add to the formula to accomodate this? Do I need to change it from a measure to a column? I've noticed that using a measure in the legend of a visual often does not work. Thank you for your help! amitchandak1.6KViews0likes2Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.