Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Percent Calculation by row

I have a list of projects with total revenue and percent incremental revenue and percent replacement revenue. I can't seem to get my formula to work. I would want it to say:   Incremental Revenue =...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Ok - so don't know if this was my EASIEST way to get there - so always looking for ways to clean this up. But here's what I came up with:

    Incremental Revenue = row("Amount", SUM(AllocatedProjectRevenue[Amount]))*row("Percent Incremental", MAX(AllocatedProjectRevenue[Percent Incremental ]))
     
    Replacement Revenue =
    IF (
    ISBLANK (
    ROW ( "Amount", SUM ( AllocatedProjectRevenue[Amount] ) )
    * ROW (
    "Percent Replacement", MAX ( AllocatedProjectRevenue[Percent Replacement ] )
    )
    ),
    ROW ( "Amount", SUM ( AllocatedProjectRevenue[Amount] ) ),
    ROW ( "Amount", SUM ( AllocatedProjectRevenue[Amount] ) )
    * ROW (
    "Percent Replacement", MAX ( AllocatedProjectRevenue[Percent Replacement ] )
    )
    )
     
    Revenue Type Dynamic =
    IF (
    SELECTEDVALUE ( 'Select Revenue Type'[Revenue Type] ) = "Incremental",
    [Incremental Revenue],
    IF (
    SELECTEDVALUE ( 'Select Revenue Type'[Revenue Type] ) = "Replacement",
    [Replacement Revenue],
    [Incremental Revenue] + [Replacement Revenue]
    )
    )