Forum Discussion

astronauta49's avatar
astronauta49
Icon for Helper I rankHelper I
5 years ago
Solved

Crecimiento anual

Hola   No consigo hacer en DAX las formulas de crecimiento anual (en valor absoluto y porcentaje), filtrado por proyecto. En el excel tengo las tres primeras columnas. En Power Bi, necesito las d...
  • Syndicate_Admin's avatar
    5 years ago

    No @Syndicate_Admin ,

    Primero cree una columna de índice en el editor de consultas;

    A continuación, cree 2 columnas calculadas como se indica a continuación:

    col_Crecim. in num absol = 
    var _perviousvalue=CALCULATE(MAX('Table'[billing]),FILTER('Table','Table'[Index]=EARLIER('Table'[Index])-1&&'Table'[project]=EARLIER('Table'[project])))
    Return
    IF(ISBLANK(_perviousvalue),BLANK(),'Table'[billing]-_perviousvalue)
    col_Grew up. in % = 
    var _perviousvalue=CALCULATE(MAX('Table'[billing]),FILTER('Table','Table'[Index]=EARLIER('Table'[Index])-1&&'Table'[project]=EARLIER('Table'[project])))
    Return
    IF(ISBLANK(_perviousvalue),BLANK(),DIVIDE('Table'[col_Crecim. in num absol],_perviousvalue))

    O 2 medidas como las siguientes:

    measure_Crecim. in num absol = 
    var _perviousvalue=CALCULATE(MAX('Table'[billing]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])-1&&'Table'[project]=MAX('Table'[project])))
    Return
    IF(ISBLANK(_perviousvalue),BLANK(),MAX('Table'[billing])-_perviousvalue)
    measure_Grew up. in % = 
    var _perviousvalue=CALCULATE(MAX('Table'[billing]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])-1&&'Table'[project]=MAX('Table'[project])))
    Return
    IF(ISBLANK(_perviousvalue),BLANK(),DIVIDE(MAX('Table'[col_Crecim. in num absol]),_perviousvalue))

    Y verás:

    vkellymsft_0-1624862460888.png

    Para el archivo .pbxi relacionado, pls vea adjunto.

    Saludos
    Kelly

    ¿Respondí a su pregunta? Marcar mi post como una solución!