Forum Discussion

Carol_oteg's avatar
Carol_oteg
Frequent Visitor
3 years ago
Solved

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
  • 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!

7 Replies

  • Shaurya's avatar
    Shaurya
    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!

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    Prueba con:

    MOVIMIENTOS CONTABLE =
    SUMX ( DIM_CUENTAS, ABS ( [Total_Movimientos] ) )
    
    • Carol_oteg's avatar
      Carol_oteg
      Frequent Visitor

      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.

  • Carol_oteg's avatar
    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,
     
    • Shaurya's avatar
      Shaurya
      Memorable Member

      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 

    • Shaurya's avatar
      Shaurya
      Memorable Member

      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