The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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!!!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.