Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hola equipo,
Intenté obtener el valor de fila anterior de la columna "P" basado en la columna "Año" con debajo de DAX para agregar NUEVA columna "Previous_P",
ID de grupo estadístico | Año | P |
112042 | 2021 | 0 |
112042 | 2022 | 0 |
112042 | 2023 | 0 |
112042 | 2024 | 164.74 |
112042 | 2025 | 159.8 |
112042 | 2026 | 155.01 |
112042 | 2027 | 150.36 |
112042 | 2028 | 145.85 |
137165 | 2021 | 0 |
137165 | 2022 | 0 |
137165 | 2023 | 0 |
137165 | 2024 | 0 |
137165 | 2025 | 8525.5 |
137165 | 2026 | 8270.5 |
137165 | 2027 | 8024 |
137165 | 2028 | 7862.5 |
Previous_P = SUMX(FILTER(Sheet1,Sheet1[Year]=EARLIER(Sheet1[Year])-1),Sheet1[P])
después de aplicar por encima de DAX, pude obtener el siguiente resultado:
pero lo que quiero es obtener "previous_P" con grupo de diferente valor de "Statistic Group ID".
Intenté usar DAX como se muestra a continuación, pero no pude obtener los datos esperados:
Previous_P =
CALCULATE(
SUMX('Sheet1',Sheet1[P]),
FILTER(Sheet1,Sheet1[Year]=(Sheet1[Year])-1),ALLEXCEPT(Sheet1,Sheet1[Statistic Group ID])
)
¿Podría apoyar para proponer cómo puedo obtener los datos esperados?
¡Gracias!
Solved! Go to Solution.
@alson2002 , Prueba como
Previous_P = SUMX(FILTER(Sheet1,Sheet1[Year]=EARLIER(Sheet1[Year])-1 && Sheet1[Statistic Group ID] = earlier(Sheet1[Statistic Group ID] ) ),Sheet1[P])
@alson2002 , Prueba como
Previous_P = SUMX(FILTER(Sheet1,Sheet1[Year]=EARLIER(Sheet1[Year])-1 && Sheet1[Statistic Group ID] = earlier(Sheet1[Statistic Group ID] ) ),Sheet1[P])
Genial, gracias!!!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.