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

Recuento de entradas por un período de tiempo

Necesito contar un "ID de secuencia de comandos de prueba" para el período (cada año/mes) que el script permaneció en Estado-Cerrado y, a continuación, una vez que el script cambia a State-Decomissioned OR Validated-Out of Scope, me gustaría que dejara de contar el script para el año/mes.

Vea la tabla a continuación.
Nota: FirstStatusChangedDate es lo que estoy usando en mi segmentación de fecha.

Ejemplo de tabla actual:

ID de script de pruebaEstadoValidadoFirstStatusChangedDate
6CerradoNo analizado22/02/2017 15:14
6CerradoNo iniciado22/02/2017 15:14
6CerradoBoleto22/02/2017 15:14
6CerradoValidado22/02/2017 15:14
6DecomissionedNo analizado6/04/2020 12:55
8Cerrado 22/02/2017 15:14
8CerradoSer probado22/02/2017 15:14
8CerradoNo analizado22/02/2017 15:14
8CerradoValidado22/02/2017 15:14
8DecomissionedNo analizado6/04/2020 12:55
9Cerrado 22/02/2017 15:14
9CerradoNo iniciado22/02/2017 15:14
9CerradoFuera del alcance10/08/2019 15:14
9CerradoValidado2/11/2019 15:14
9DecomissionedFuera del alcance27/04/2020 14:36
32DecomissionedNo analizado6/02/2018 15:27
36CerradoNo analizado22/02/2017 15:14
36CerradoNo iniciado22/02/2017 15:14
36CerradoValidado22/02/2017 15:14
36DecomissionedNo analizado6/04/2020 12:51



Resultado esperado:
Id. de script 6, debe mostrarse desde el 22/02/2017 hasta el 05/04/2020 porque se descomisionó el 06/04/2020 (debe contar cada mes, así que si selecciono Feb/17 debería mostrar el script, si selecciono Mar/17, si selecciono Apr/17 debería mostrar el script y así sucesivamente. Pero si sólo selecciono el año 2017 en mi segmentación de datos, debe contar como sólo 1 script, si selecciono año 2018, debe contar como 1 guión y así sucesivamente para la selección del año, todavía mostrando cada mes hasta 05/04/2020, pero de nuevo si selecciono año 2020, debe mostrarse como 1 script).
El ID de script es 8, debe mostrar desde el 22/02/2017 hasta el 05/04/2020.
El ID de script n.o 9, debe mostrar desde el 22/02/2017 hasta el 09/08/2019, entonces debe dejar de mostrar desde el 10/08/2019 hasta el 01/11/2019 (Validado-Fuera del alcance) y luego mostrar de nuevo desde 02/11/2019 hasta el 26/04/2020 y luego dejar de mostrar desde 27/04/2020.
Id. de script 32, nunca debe mostrarse.
Id. de script 36, debe mostrar desde 22/02/2017 hasta 05/04/2020.


Por favor, hágamelo saber el paso a paso de dónde agregar sus sugerencias en Power BI, ya que sigo siendo muy básico.

Gracias

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

Intente agregar esto como COLUMNAS calculadas en DAX:

ScriptRank á RANKX(FILTER(Script, Script[Test Script ID]-EARLIER(Script[Test Script ID])), Script[FirstStatusChangedDate], ,ASC,Dense)

ValidationCount ? COUNTROWS(FILTER(Script, Script[Test Script ID]-EARLIER(Script[Test Script ID]) && Script[Validated]-"Validated" && Script[ScriptRank]<-EARLIER(Script[ScriptRank] )))

OutOfScopeCount ? COUNTROWS(FILTER(Script, Script[Test Script ID]-EARLIER(Script[Test Script ID]) && Script[Validated]-"Out of Scope" && Script[ScriptRank]<-EARLIER(Script[ScriptRank] )))

Actividad: IF(Script[State]-"Decomissioned" Script[Validado]-"Fuera del ámbito" Script[ValidationCount]&lt;script[OutOfScopeCount] , "Inactive", "Active")

A continuación, filtre el objeto visual para cuando Actividad - Activo, además del filtro de fecha que ya tiene.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

1 REPLY 1
AllisonKennedy
Super User
Super User

Intente agregar esto como COLUMNAS calculadas en DAX:

ScriptRank á RANKX(FILTER(Script, Script[Test Script ID]-EARLIER(Script[Test Script ID])), Script[FirstStatusChangedDate], ,ASC,Dense)

ValidationCount ? COUNTROWS(FILTER(Script, Script[Test Script ID]-EARLIER(Script[Test Script ID]) && Script[Validated]-"Validated" && Script[ScriptRank]<-EARLIER(Script[ScriptRank] )))

OutOfScopeCount ? COUNTROWS(FILTER(Script, Script[Test Script ID]-EARLIER(Script[Test Script ID]) && Script[Validated]-"Out of Scope" && Script[ScriptRank]<-EARLIER(Script[ScriptRank] )))

Actividad: IF(Script[State]-"Decomissioned" Script[Validado]-"Fuera del ámbito" Script[ValidationCount]&lt;script[OutOfScopeCount] , "Inactive", "Active")

A continuación, filtre el objeto visual para cuando Actividad - Activo, además del filtro de fecha que ya tiene.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.