Forum Discussion
Count machinery splitted stops
- 2 years ago
Sorry mom, I used GPT.
I used GPT to see another solution and to not use an iterative DAX formula. This was the result:
ColumnaMarcador =
VAR MaquinaActual = Detenciones[Maquina]
VAR FechaHoraInicioActual = Detenciones[FechaHoraInicio]
VAR FechaHoraFinAnterior =
MAXX(
FILTER(
Detenciones,
Detenciones[Maquina] = MaquinaActual &&
Detenciones[FechaHoraFin] < FechaHoraInicioActual
),
Detenciones[FechaHoraFin]
)
RETURN
IF(
NOT ISBLANK(FechaHoraFinAnterior) &&
FechaHoraFinAnterior = FechaHoraInicioActual,
1,
0
)It's amazing that the first GPT solution was pretty similar to the one presented by Fowmy, but with the instruction of the out of memory error it managed it to make a non interative solution.
If anyone needs the prompt and chat (in spanish), here is: https://chat.openai.com/share/cc6d9a4f-9169-410c-b89c-08f61eeb44cb
Best regards.
Hi Fowmy
Thanks a lot. I tested it with the sample and it works. But, in my model there's more than 300.000 rows and 15 different machines. The column can't be calculated due to "insufficient memory error". Do you know if there's any walkaround we could take?
Thanks a lot.
Sorry mom, I used GPT.
I used GPT to see another solution and to not use an iterative DAX formula. This was the result:
ColumnaMarcador =
VAR MaquinaActual = Detenciones[Maquina]
VAR FechaHoraInicioActual = Detenciones[FechaHoraInicio]
VAR FechaHoraFinAnterior =
MAXX(
FILTER(
Detenciones,
Detenciones[Maquina] = MaquinaActual &&
Detenciones[FechaHoraFin] < FechaHoraInicioActual
),
Detenciones[FechaHoraFin]
)
RETURN
IF(
NOT ISBLANK(FechaHoraFinAnterior) &&
FechaHoraFinAnterior = FechaHoraInicioActual,
1,
0
)
It's amazing that the first GPT solution was pretty similar to the one presented by Fowmy, but with the instruction of the out of memory error it managed it to make a non interative solution.
If anyone needs the prompt and chat (in spanish), here is: https://chat.openai.com/share/cc6d9a4f-9169-410c-b89c-08f61eeb44cb
Best regards.