Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DIVIDE IF between two periods

Hello!!

 

Im tryning to find the percentage variaton between two periods, Total assets in 2019 by total assets in 2018.

 

I have the following formula:

 

 

 

Variación total (2019 - 2018) = 
    DIVIDE(
        CALCULATE(SUM(Master[Total de activos]),Master[Fecha corte]="2019") - CALCULATE(SUM(Master[Total de activos]),Master[Fecha corte]="2018"),
        CALCULATE(SUM(Master[Total de activos]),Master[Fecha corte]="2018"),
    )

 

 

However, as you guys can see there is an error.

  • Hey Anonymous ,

     

    you have one comma too much at the end.

    Remove that last comma and it will work:

     

    Variación total (2019 - 2018) =
    DIVIDE(
        CALCULATE( SUM( Master[Total de activos] ), Master[Fecha corte] = "2019" )
            - CALCULATE( SUM( Master[Total de activos] ), Master[Fecha corte] = "2018" ),
        CALCULATE( SUM( Master[Total de activos] ), Master[Fecha corte] = "2018" )
    )

     

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     

2 Replies

  • selimovd's avatar
    selimovd
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hey Anonymous ,

     

    you have one comma too much at the end.

    Remove that last comma and it will work:

     

    Variación total (2019 - 2018) =
    DIVIDE(
        CALCULATE( SUM( Master[Total de activos] ), Master[Fecha corte] = "2019" )
            - CALCULATE( SUM( Master[Total de activos] ), Master[Fecha corte] = "2018" ),
        CALCULATE( SUM( Master[Total de activos] ), Master[Fecha corte] = "2018" )
    )

     

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis