
// Marge commerciale

Marge_Commerciale = 
CALCULATE(
    SUM(Transactions[Montants]),
    FILTER(Transactions, Transactions[Comptes] = "707")
) -
CALCULATE(
    ABS(SUM(Transactions[Montants])),
    FILTER(Transactions, Transactions[Comptes] = "607")
)

_______________________________
//Production exercice 

Production_Exercice = 
CALCULATE (
    SUM ( Transactions[Montants] ),
    Transactions[Comptes] IN { "701", "704", "705" }
)


_______________________________
//Valeur ajoutée

VA = 
[Marge_Commerciale] + [Production_Exercice] - 
CALCULATE (
    ABS ( SUM ( Transactions[Montants] ) ),
    Transactions[Comptes] IN {
        "601", "604", "613", "623", "624", "625", "626", "627"
    }
)


_______________________________
//Excédent brut d'exploitation

EBE = 
[VA] - 
CALCULATE (
    ABS ( SUM ( Transactions[Montants] ) ),
    Transactions[Comptes] IN { "641", "645" }
)


_______________________________
//Résultat d'exploitation

Résultat_Exploitation = 
[EBE] 
+ CALCULATE(
    SUM(Transactions[Montants]),
    FILTER(
        Transactions,
        Transactions[Comptes] IN {"751"}
    )
)


_______________________________
// Résultat courant avant impôts

RCAI = 
[Résultat_Exploitation] +
CALCULATE (
    SUM ( Transactions[Montants] ),
    Transactions[Comptes] = "768"
) -
CALCULATE (
    ABS ( SUM ( Transactions[Montants] ) ),
    Transactions[Comptes] = "668"
)



_______________________________
// Résultat exceptionnel

Résultat_Exceptionnel = 
CALCULATE (
    SUM ( Transactions[Montants] ),
    Transactions[Comptes] = "778"
) -
CALCULATE (
    ABS ( SUM ( Transactions[Montants] ) ),
    Transactions[Comptes] = "678"
)

_______________________________
//Résultat net

Résultat_Net = 
[RCAI] + [Résultat_Exceptionnel] -
CALCULATE (
    ABS ( SUM ( Transactions[Montants] ) ),
    Transactions[Comptes] = "695"
)



