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
Anonymous
Not applicable

Devolver la fecha máxima del ID agrupado filtrado por valor en otra columna

Hola, amigos,

En primer lugar, este foro es increíble.

Quiero crear la columna "Fecha máxima por valor", que incluye la fecha más grande para cada grupo de ID que tenga el valor 2.

Esto es lo que quiero que sea una mesa así.

IdFechaValorFecha máxima por valor
111/1/201545/1/2013
15/1/201455/1/2013
15/1/201325/1/2013
211/1/20121Null
31/1/201321/1/2016
36/1/201051/1/2016
311/1/201641/1/2016
31/1/201621/1/2016
37/1/201771/1/2016

Aquí está el código con el que estoy jugando que no está funcionando:

Plazo máximo 2 Fecha ?
var a ?CALCULATE(MAX('Table'[Date]),ALLEXCEPT('Table', 'Table'[ID]), FILTER('Table', 'Table'[Value]'2))
var b ?CALCULATE(MAX('Table'[Date]), FILTER('Table', 'Table'[ID]'EARLIER('Table'[ID])),'Table'[Date]'a)
devolución
b
¿Pensamientos sobre cómo proceder?
¡Gracias!
3 REPLIES 3
amitchandak
Super User
Super User

Tratar

Columna

Fecha máxima por valor: if([Valor],2, blank(),maxx(filter('Table', [ID],earlier([ID])),[Fecha]))

Medida

Fecha máxima por valor á calculate(max(Date),ALLEXCEPT('Table', 'Table'[ID]),[Value]<>2)
Fecha máxima por valor: if(max([Valor],2),blank(),calculate(max(Date),ALLEXCEPT('Table', 'Table'[ID])))

Anonymous
Not applicable

Gracias, @amitchandak!

Anonymous
Not applicable

Creo que lo acabo de descubrir.

CALCULATE(MAX('Table'[Date]), FILTER('Table', 'Table'[ID]'EARLIER('Table'[ID])),'Tabla'[Valor]-2)
Lo estaba pensando demasiado, pero puede haber una mejor manera.

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.