This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Estoy intentando devolver la primera fecha mínima para todas las filas.
Necesito medir aquí porque todos los campos provienen de 3 tablas diferentes.
Vea los ejemplos a continuación.
| fecha | material | acción |
| 6/1/2022 | 101 | -200 |
| 7/1/2022 | 101 | -100 |
| 8/1/2022 | 101 | 100 |
| 9/1/2022 | 101 | 200 |
| 10/1/2022 | 101 | -100 |
| 11/1/2022 | 101 | -50 |
Resultado esperado :
| fecha | material | acción | resultado |
| 6/1/2022 | 101 | -200 | 6/1/2022 |
| 7/1/2022 | 101 | -100 | 6/1/2022 |
| 8/1/2022 | 101 | 100 | 8/1/2022 |
| 9/1/2022 | 101 | 200 | 8/1/2022 |
| 10/1/2022 | 101 | -100 | 10/1/2022 |
| 11/1/2022 | 101 | -50 | 10/1/2022 |
¿Puede somone ayudarme en esto, por favor?
Hola
No estoy seguro de si entendí su pregunta correctamente, pero asumí que el resultado esperado muestra una fecha mínima para los grupos de acciones menos o más acciones.
Por favor, compruebe la imagen de abajo y el archivo pbix adjunto.
Todas las medidas están en el archivo pbix adjunto, y cada una de ellas está numerada como un paso a seguir.
step one plus minus change index: =
VAR _currentstock =
SUM ( Data[stock] )
VAR _currentdate =
MAX ( Data[date] )
VAR _currentmaterial =
MAX ( Data[material] )
VAR _previousdate =
MAXX (
FILTER (
ALL ( Data ),
Data[material] = _currentmaterial
&& Data[date] < _currentdate
),
Data[date]
)
VAR _previousstock =
SUMX (
FILTER (
ALL ( Data ),
Data[material] = _currentmaterial
&& Data[date] = _previousdate
),
Data[stock]
)
RETURN
IF( HASONEVALUE( Data[date]),
IF ( _currentstock * _previousstock < 0, 1, 0 )
)
step two Group of change index: =
IF (
HASONEVALUE ( Data[date] ),
SUMX (
FILTER (
ALL ( Data ),
Data[material] = MAX ( Data[material] )
&& Data[date] <= MAX ( Data[date] )
),
[step one plus minus change index:]
)
)
step three group by step two: =
VAR _currentgroup = [step two Group of change index:]
VAR _newtable =
FILTER (
ADDCOLUMNS (
FILTER ( ALL ( Data ), Data[material] = MAX ( Data[material] ) ),
"@group", [step two Group of change index:],
"@stock", CALCULATE ( SUM ( Data[stock] ) )
),
[@group] = _currentgroup
)
VAR _findminstock =
MAXX (
GROUPBY ( _newtable, [@group], "@minstock", MINX ( CURRENTGROUP (), [@stock] ) ),
[@minstock]
)
RETURN
IF (
HASONEVALUE ( Data[date] ),
MAXX ( FILTER ( _newtable, Data[stock] = _findminstock ), Data[date] )
)
Gracias @Jihwan_Kim por su apoyo. Sí, tienes toda la razón.
Traté de replicar lo mismo en mi informe actual, pero no pude resolverlo.
aquí está el archivo:
https://drive.google.com/file/d/1-HdbdhwZ_Voxb1-tjjsd8sTlKzolXLAC/view?usp=drivesdk
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.