Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Syndicate_Admin
Administrator
Administrator

cómo calcular con un filtro específico

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ísticoAñoP
11204220210
11204220220
11204220230
1120422024164.74
1120422025159.8
1120422026155.01
1120422027150.36
1120422028145.85
13716520210
13716520220
13716520230
13716520240
13716520258525.5
13716520268270.5
13716520278024
13716520287862.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:

2021-10-18_14h15_17.png

pero lo que quiero es obtener "previous_P" con grupo de diferente valor de "Statistic Group ID".

alson2002_0-1634538316459.png

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!

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@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])

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@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!!!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors