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
eduardosilvin
Helper II
Helper II

Bring previous balance

Hi guys

 

I have many rows, with the account, account description, debits, credits, and the initial balance and the final balance, so my query for the initial balance is:

Saldo inicial =
VAR __Account = MAX([CTA_CONTABLE])
VAR __MinDate = MINX(FILTER('4 Saldos','4 Saldos'[CTA_CONTABLE] = __Account),[FECHA])
RETURN
(MINX(FILTER('4 Saldos','4 Saldos'[CTA_CONTABLE] = __Account && [FECHA] = __MinDate),[SALDO_INICIAL]))
 
With this I bring the initial balance of the last register (order by dates), because each raw is for a debit or a credit. 
My problem is when I filter for dates, if the last movement of the the account "xx-xx-xx" was on april 2019, and in 2020 I don't have any movements, it will never be shown with this filter. How could I indicate that I want to continue showing the accounts with the final balance <>0, in order to have the real balance in each filtered period?
1 ACCEPTED SOLUTION

@yingyinr Hola, lo arreglé con:

Saldo inicial1 =
VAR __Account á MAX([CTA_CONTABLE])
VAR __MinDate = MINX(FILTER('3Saldo ini','3Saldo ini'[CTA_CONTABLE] = __Account),[PERIODO])
devolución
CALCULATE(SUM('3Saldo ini'[SALDO_INICIAL]),filter( '3Saldo ini','3Saldo ini'[CTA_CONTABLE] á __Account && [PERIODO] á __MinDate ))
Estaba seleccionando mal las columnas
Muchas gracias

Atentamente

Eduardo Silva

View solution in original post

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

@eduardosilvin

Es posible que desee explorar las funciones disponibles, como OPENINGBALANCEMONTH

https://dax.guide/openingbalancemonth/





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown thank you Paul, but how could I applied it if I could filtered by different periods of time 

 

eduardosilvin_0-1601638484286.png

(account -  open balance -  debits -  credits - final balance)

Hola @eduardosilvin ,

Lamento tener alguna confusión sobre su requisito. ¿Podría proporcionar más datos de muestra y explicar su problema y resultado deseado con ejemplos de datos específicos? ¿Y podría enumerar los campos/medidas que se aplicaron en Matrix y slicer? ¿Son de la misma mesa?


Mi problema es cuando filtro para fechas, si el último movimiento de la cuenta "xx-xx-xx" fue en abril 2019, y en 2020 no tengo ningún movimiento, nunca se mostrará con este filtro. ¿Cómo podría indicar que quiero seguir mostrando las cuentas con el saldo final <>0, con el fin de tener el saldo real en cada período filtrado?


Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@yingyinr Hola, lo arreglé con:

Saldo inicial1 =
VAR __Account á MAX([CTA_CONTABLE])
VAR __MinDate = MINX(FILTER('3Saldo ini','3Saldo ini'[CTA_CONTABLE] = __Account),[PERIODO])
devolución
CALCULATE(SUM('3Saldo ini'[SALDO_INICIAL]),filter( '3Saldo ini','3Saldo ini'[CTA_CONTABLE] á __Account && [PERIODO] á __MinDate ))
Estaba seleccionando mal las columnas
Muchas gracias

Atentamente

Eduardo Silva

amitchandak
Super User
Super User

@eduardosilvin ,¿Puede compartir datos de ejemplo y salida de ejemplo en formato de tabla? O una muestra de pbix después de eliminar datos confidenciales.

@amitchandak oye, claro:

eduardosilvin_0-1601631966849.png

por ejemplo, esta cuenta es un activo, cuando filtro por fecha, seleccionando 2019, todo está bien, porque mi fecha para esta fila es 2019, pero cuando filtro cualquier mes o el año completo 2020, el problema es que el sistema no encuentra esa cuenta en esas fechas y mi suma de activos no toma esa cuenta.

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