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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
elouizi
Helper II
Helper II

Registro de duración anterior

Hola

Soy nuevo en Power BI. Quiero calcular el registro de duración anterior de un proyecto. He estado intentando con la función Anterior. Pero eso no funcionó para mí. Por favor, no use la fucntion anterior Año porque las fechas varían mucho. este es sólo un ejemplo simple


¿Alguien puede ayudarme, por favor?

saludos

ElouiziCapture.JPG

1 ACCEPTED SOLUTION

Hola

Esta columna calculada funciona bien

=LOOKUPVALUE('Duration'[Duration],'Duration'[Date],CALCULATE(MAX('Duration'[Date]),FILTER('Duration','Duration'[Brand]=EARLIER('Duration'[Brand])&&'Duration'[Date]<EARLIER('Duration'[Date]))),'Duration'[Brand],'Duration'[Brand])

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hola

Esta fórmula de columna calculada funciona

=LOOKUPVALUE(Data[DurationinMinutes],Data[Date],CALCULATE(MAX(Data[Date]),FILTER(Data,Data[Brand]=EARLIER(Data[Brand])&&Data[Date]<EARLIER(Data[Date]))),Data[Brand],Data[Brand])

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hola Ashish_Mathur,

Mi repetición fue para ti. :).

elouizi_0-1598781566524.png

No sé por qué, pero dice que no puede encontrar la columna "marca" y las columnas "fecha".
¿Hay otra forma de resolver esto sin crear un colum? De lo contrario, es posible que necesite crear muchas otras columnas

¡Gracias!

Hola

Comparte el enlace desde donde puedo descargar tu archivo PBI.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hola Ashish,

Por favor, encuentre los enlaces a continuación:

archivo de datos (archivo Excel y pbix)

https://mega.nz/file/9aYRBIRa#IO2OJ9T9xOo63BGMMjbKBxPGYZ78xwMNkhsPboBdBAY

https://mega.nz/file/lOJnQSaZ#GKScuWtFwcFh6-N-AhBz-mnP9buWpi60LHH4RstEVMQ

Muchas gracias!

Hola

Esta columna calculada funciona bien

=LOOKUPVALUE('Duration'[Duration],'Duration'[Date],CALCULATE(MAX('Duration'[Date]),FILTER('Duration','Duration'[Brand]=EARLIER('Duration'[Brand])&&'Duration'[Date]<EARLIER('Duration'[Date]))),'Duration'[Brand],'Duration'[Brand])

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Se ve increíble. ¿Hay alguna manera de usarlo como un desorden? Debido a que necesito hacer otros cálculos, de lo contrario necesito crear una gran cantidad de columnas (lo que afectará el rendimiento)

¿A quién estás respondiendo? ¿Funcionó mi fórmula de columna calculada?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

@elouizi - Si desea crear una columna, puede utilizar ANTES, consulte mi artículo sobre el tiempo medio entre errores (MTBF) que utiliza EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
El patrón básico es:
Columna ?
VAR __Current á [Valor]
VAR __Previous á MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Value])
devolución
__Current - __Previous

Si desea una medida, entonces @mahoneypat fórmula 's debería funcionar.


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
mahoneypat
Employee
Employee

¿Está intentando crear una nueva columna o medida? Aquí hay una expresión de medida que debería funcionar. Reemplace "Table" por el nombre real de la tabla y pruébelo en un objeto visual de tabla con las columnas Fecha, Marca y Duración.

LastDuration =
VAR thisdate =
    MIN ( Table[Date] )
RETURN
    CALCULATE (
        LASTNONBLANKVALUE ( Table[Date], MAX ( [Table[Duration] ) ),
        ALLEXCEPT ( Table, Table[Brand] ),
        Table[Date] < thisdate
    )

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hola

Muchas gracias por su rápida respuesta.

Probé la fórmula. Pero me mostró las fechas anteriores y no la duración anterior.

Cambié un poco la fórmula para obtener la duración de ella. Pero no me dio los resultados esperados.

¿Podría explicar la fórmula? Soy un novato que quiere aprender cosas nuevas.

¡Gracias!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors