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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Sumar el máximo dentro de un valor agrupado

Hola

Me gustaría calcular lo siguiente en una medida (ver captura de pantalla):

Capture.JPG

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

No @topigs_user,

Compruebe las medidas como se indica a continuación.

Measure = 
var max_date = CALCULATE(MAX('Table'[date]),ALLEXCEPT('Table','Table'[plantid]))
return
IF(SELECTEDVALUE('Table'[date])=max_date,SUM('Table'[value]),BLANK())

Measure 2 = SUMX('Table',[Measure])

1.PNG

Saludos

Jay

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

No @topigs_user,

Compruebe las medidas como se indica a continuación.

Measure = 
var max_date = CALCULATE(MAX('Table'[date]),ALLEXCEPT('Table','Table'[plantid]))
return
IF(SELECTEDVALUE('Table'[date])=max_date,SUM('Table'[value]),BLANK())

Measure 2 = SUMX('Table',[Measure])

1.PNG

Saludos

Jay

Syndicate_Admin
Administrator
Administrator

Aquí hay una expresión de medida que debería funcionar.

Valor reciente ( RecentValue)
VAR vLastValue ?
SUMX (
VALORES ( T1[PlantID] ),
CALCULAR (
LASTNONBLANKVALUE (
T1[Fecha],
PROMEDIO ( T1[Valor] )
)
)
)
devolución
SI (
O (
NO (
HASONEVALUE ( T1[PlantID] )
),
MAX ( T1[Fecha] )
CALCULAR (
MAX ( T1[Fecha] ),
ALLSELECTED ( T1[Fecha] )
)
),
vLastValue
)

palmadita

Hola, gracias por su apoyo.

Desafortunadamente, no es el truco.

Me muestra 15 en todas las filas donde plantid es 456. Sólo quiero verlo en la fila donde la fecha de modificación es la fecha máxima.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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