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
Carol_oteg
Frequent Visitor

Informes Financieros

Hola a todos, estoy construyendo un Informe financiero de pérdidas y ganancias, SAP me arroja los ingresos negativos y deseo generar una medida que me los pase a positivo sin que me afecte la información de los gastos (estos salen positivos y deseo que continuen así)

 

Mi modelo de datos tiene relacionadas dos tablas la de hechos con la información contable y para la cual creé una medida denominada "Total_Movimientos" que es la que me suma todos los movimientos contables tanto para ingresos como gastos y adicional tengo mi tabla de dimensiones denominada DIM_CUENTAS en donde tengo vinculada la información de la estructura del Informe, estuve intentando con la siguiente fórmula, pero me siguen saliendo los ingresos negativos, alguien tiene alguna idea de como podría solucionarlo?

 

MOVIMIENTOS CONTABLE = SUMX(DIM_CUENTAS,IF(DIM_CUENTAS[Categoria]="Ingresos Operacionales" && DIM_CUENTAS[Categoria]="Ingresos no operacionales", [Total_Movimientos]*-1,[Total_Movimientos]))
 
Graciasss
1 ACCEPTED SOLUTION
Shaurya
Memorable Member
Memorable Member

Hi @Carol_oteg,

 

Instead of multiplying [Total_Movement] by -1 during the calculation itself, why don't add them all first and then check if the sum is negative or not. That way you can use the same measure for income and expenses if you want.

 

Try:

 

Income = var _income = SUMX(DIM_ACCOUNTS,IF(DIM_ACCOUNTS[Category]="Operating Income" || DIM_ACCOUNTS[Category]="Non-operational income",  [Total_Movements], 0))
return
IF(_income<0, _income*-1 ,_income)

 

Works for you? Mark this post as a solution if it does!

View solution in original post

7 REPLIES 7
Carol_oteg
Frequent Visitor

Muchas gracias @Shaurya, funcionó muy bien, lo único es que no me permite usar funciones de inteligencia de tiempo, ya que quiero calcula el valor para el mismo periodo del año anterior con sameperiodlastyear o parallelperiod y no me genera ningún resultado, ¿esto podría ser causado por la creación de la medida "Income"?

 

Lo que hice fue crear la medida income, tal como lo sugirió: 

Ingresos = var _income = SUMX(DIM_CUENTAS,IF(DIM_CUENTAS[Categoria]="Ingresos Operacionales" || DIM_CUENTAS[Categoria]="Ingresos no operacionales",  [Total_Movimientos], 0))
return
IF(_income<0, _income*-1 ,_income)
 
Luego creé la de gastos:
 
Gastos = var _expense = SUMX(DIM_CUENTAS,IF(DIM_CUENTAS[Categoria]<>"Ingresos Operacionales" && DIM_CUENTAS[Categoria]<>"Ingresos no operacionales",  [Total_Movimientos], 0))
return
_expense
 
y finalmente una que sumara las dos:
 
Movimientos_final = [Ingresos]+[Gastos]
 
Hice mal? porque ahora intento crear medidas de inteligencia de tiempo con "Movimientos_final" y no me sale ningún resultado, por ejemplo:
 
PY = CALCULATE([Movimientos_final],PARALLELPERIOD(CALENDAR_TABLE[Fecha],-1,YEAR))
 
Muchas gracias,
 

Hi @Carol_oteg,

 

Time Intelligence can fail because of the following reasons:

 

  1. Date table not marked as Date Table.
  2. Null/Error Values in Date Column.
  3. Discontinuous Dates.
  4. Bidirectional Joins.

 

Please check these in your model.

 

Did I answer your question? Mark this post as a solution if I did!
Consider taking a look at my blog: Forecast Period - Graphical Comparison 

Hi @Carol_oteg,

 

Time Intelligence can fail because of the following reasons:

 

  1. Date table not marked as Date Table.
  2. Null/Error Values in Date Column.
  3. Discontinuous Dates.
  4. Bidirectional Joins.

 

Please check these in your model.

 

Did I answer your question? Mark this post as a solution if I did!
Consider taking a look at my blog: Forecast Period - Graphical Comparison 

Muchas gracias @Shaurya , voy a verificar

PaulDBrown
Community Champion
Community Champion

Prueba con:

MOVIMIENTOS CONTABLE =
SUMX ( DIM_CUENTAS, ABS ( [Total_Movimientos] ) )




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.






Muchas gracias @PaulDBrown tambien funciona, aunque me fijé que tambien tengo algunos pocos gastos que me salen negativos y no quiero que me cambien de signo.

Shaurya
Memorable Member
Memorable Member

Hi @Carol_oteg,

 

Instead of multiplying [Total_Movement] by -1 during the calculation itself, why don't add them all first and then check if the sum is negative or not. That way you can use the same measure for income and expenses if you want.

 

Try:

 

Income = var _income = SUMX(DIM_ACCOUNTS,IF(DIM_ACCOUNTS[Category]="Operating Income" || DIM_ACCOUNTS[Category]="Non-operational income",  [Total_Movements], 0))
return
IF(_income<0, _income*-1 ,_income)

 

Works for you? Mark this post as a solution if it does!

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.