Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Tengo esta tabla, solo necesito filtrar las 2 últimas fechas para cada inventserialID que tenga un Generador de horas existente.
2 LAST DATES = Var _invent = FIRSTNONBLANK('Table'[INVENTSERIALID],"") vAR _latestdate = CALCULATE(max('Table'[CALCULATIONDATETIME]),ALLEXCEPT('Table','Table'[INVENTSERIALID])) vAR _2ndlatest = MAXX(FILTER(filter('Table','Table'[INVENTSERIALID]=_invent),'Table'[CALCULATIONDATETIME]<_latestdate),'Table'[CALCULATIONDATETIME]) RETURN IF('Table'[CALCULATIONDATETIME] IN {_latestdate,_2ndlatest},'Table'[CALCULATIONDATETIME])
Lo anterior funcionó pero no toma las horas del generador que tiene el valor existente en él, solo toma la fecha máxima y 2ª máxima para cada serialID. ¿Puede alguien decirme qué cambios hay que hacer?
Solved! Go to Solution.
Hay @axk180022
Puede consultar la medida a continuación.
2 LAST DATES =
Var _latestdate = CALCULATE(max('Table'[CALCULATIONDATETIME]),FILTER(ALLEXCEPT('Table','Table'[INVENTSERIALID]),'Table'[Generator hours]<>0))
Var _2ndlatest = CALCULATE(max('Table'[CALCULATIONDATETIME]),FILTER(ALLEXCEPT('Table','Table'[INVENTSERIALID]),'Table'[Generator hours]<>0 && 'Table'[CALCULATIONDATETIME]<_latestdate))
RETURN
IF(SELECTEDVALUE('Table'[CALCULATIONDATETIME]) IN {_latestdate,_2ndlatest},SELECTEDVALUE('Table'[CALCULATIONDATETIME]))
Y el resultado final es el mostrado:
Saludos
Equipo de apoyo a la comunidad _ Ailsa Tao
Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.
Hay @axk180022
Puede consultar la medida a continuación.
2 LAST DATES =
Var _latestdate = CALCULATE(max('Table'[CALCULATIONDATETIME]),FILTER(ALLEXCEPT('Table','Table'[INVENTSERIALID]),'Table'[Generator hours]<>0))
Var _2ndlatest = CALCULATE(max('Table'[CALCULATIONDATETIME]),FILTER(ALLEXCEPT('Table','Table'[INVENTSERIALID]),'Table'[Generator hours]<>0 && 'Table'[CALCULATIONDATETIME]<_latestdate))
RETURN
IF(SELECTEDVALUE('Table'[CALCULATIONDATETIME]) IN {_latestdate,_2ndlatest},SELECTEDVALUE('Table'[CALCULATIONDATETIME]))
Y el resultado final es el mostrado:
Saludos
Equipo de apoyo a la comunidad _ Ailsa Tao
Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.
@axk180022 , Crear una nueva columna
nueva columna
Rank = rankx(filter('Table', 'Table'[INVENTSERIALID] = anterior('Table'[INVENTSERIALID] )), [CALCULATIONDATETIME],,desc,dense)
y crear una medida como
calculate( sumx(values('Table'[INVENTSERIALID]), CALCULATE(sum('Table'[generatehours]))), filter( 'Table', 'Table'[Rank] <= min('Table'[Rank]) +1))
Hola
De la tabla anterior requeriría las 2 últimas fechas que están resaltadas en amarillo. La solución anterior le da horas al generador.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.