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

Calcular diferencia entre dos capitales asociados a un rut

Hola Comunidad,

 

Necesito ayuda para calcular la diferencia entre dos filas (capital) asociados a un MISMO rut y documento. Cada fila muestra un monto de capital asociado a una fecha correspondiente.

 

Adjunto información de como necesito que se muestre (necesito obtener la columna en negrita):

 

DocumentoRutFechaCapitalDif. Capital
1234561234567807-12-202224190
9876545555555524-11-202110000
9901119876543221-01-20196508,970
9901119876543229-05-20196697188,03
9901119876543211-12-20196634-63
9901119876543213-05-20207290656
9901119876543203-12-20207258-32
9901119876543226-05-2021735698
9901119876543205-11-202188661510
9901119876543201-12-20218795-71
9901119876543204-03-20228759-36
9901119876543227-04-20229345586
9901119876543205-07-20229588243
9901119876543206-02-202310136548

 

Saludos y muchas gracias

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@Syndicate_Admin Vea mi artículo sobre el tiempo medio entre fallas (MTBF) que usa ANTES: 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 __PreviousDate = MAXX(FILTER('Tabla','Tabla'[Fecha] < ANTERIOR('Tabla'[Fecha])),[Fecha])

VAR __Previous = MAXX(FILTER('Tabla',[Fecha]=__PreviousDate),[Valor])
DEVOLUCIÓN
__Current - __Previous

Anonymous
Not applicable

Muchas gracias por tu ayuda ... estuve intentando hacerlo según tu ejemplo y me funciona ... pero como podría condicionar esta columna calculada en base a RUT y Documento ?

Este código me funciono, pero necesito condicionarlo:

Variación =
VAR _Actual = Hoja1[Capital]
VAR _Previous = MAXX(FILTER(Hoja1,Hoja1[Capital] < _Actual),Hoja1[Capital])
return
(_Actual - _Previous)
 
 
Muchas gracias estimado!

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.