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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Buscar la primera aparición del valor según la fecha y la cadena

Hola datanauts,

En PBI (ejemplo en la tabla siguiente), necesito obtener la columna "VeryFirstTestOkay", que da valores booleanos según varias condiciones de filtrado.

La columna "VeryFirstTestOkay" solo devolverá 1 si:

  1. todas las filas han sido ordenadas por "Timestamp" ascendente &&
  2. "Texto" contiene "0 Errores" &&
  3. "Texto" no ha sido "0 Errores" ">0 Errores" antes de

En palabras humanas: Tengo que averiguar, si un artículo ha pasado por una prueba sin errores en la primera vez o no.

ArtículoTimestampMensaje de textoVeryFirstTestOkayPor qué "FirstTestOkay" tiene su valor
A04.08.2020 10:27Inicio del sistema00 - porque "Texto" no contiene ">0 Errores"
A04.08.2020 10:29Prueba de resistencia00 - porque "Texto" no contiene ">0 Errores"
A04.08.2020 10:300 Errores11 - porque "Texto" contiene ">0 Errores"
B04.08.2020 10:35Inicio del sistema00 - porque "Texto" no contiene ">0 Errores"
B04.08.2020 10:36Fracaso00 - porque "Texto" no contiene ">0 Errores"
C04.08.2020 10:40Inicio del sistema00 - porque "Texto" no contiene ">0 Errores"
C04.08.2020 10:41Prueba de resistencia00 - porque "Texto" no contiene ">0 Errores"
C04.08.2020 10:431 Error00 - porque "Texto" contiene ">0 Errores"
C04.08.2020 10:44Inicio del sistema00 - porque "Texto" no contiene ">0 Errores"
C04.08.2020 10:460 Errores11 - porque "Texto" contiene ">0 Errores" y el artículo no se ha probado antes.
A05.08.2020 15:11Inicio del sistema00 - porque "Texto" no contiene ">0 Errores"
A05.08.2020 15:121 Error00 - porque "Texto" no contiene ">0 Errores" & "VeryFirstTestOkay" ya se ha establecido en 1 para este artículo
1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@dyiezb24 - Así que básicamente esto es Búsqueda Min / Max https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434

VeryFirstTestOkay = 
  VAR __Min = MINX(FILTER('Table',[Text] = "0 Errors" && [Article] = EARLIER('Table'[Article])),[Timestamp]
RETURN
  IF([Timestamp] = __Min && [Text] = "0 Errors",1,0)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors