Forum Discussion

eegarlepp's avatar
eegarlepp
Frequent Visitor
7 years ago
Solved

Total revenue generated per year combining multiple roles?

Trying to show total revenue generated for a particular individual taking into account their support whether as a Primary or Secondary supporter for an Oppty by Year. For example, Ed, Ihave created a...
  • TeigeGao's avatar
    7 years ago

    Hi eegarlepp ,

    According to your description, my understanding is that you want to count the total Revenue for each person every year whether he is primary or secondary.

    In this scenario, we can first create a person table like below:

    Individual =
    DISTINCT (
        UNION (
            FILTER ( VALUES ( Table1[Primary] ), LEN ( Table1[Primary] ) > 0 ),
            FILTER ( VALUES ( Table1[Secondary] ), LEN ( Table1[Secondary] ) > 0 )
        )
    )

    The create a relationship between this table and original table, then create a measure using the below DAX query:

    Measure =
    CALCULATE (
        SUM ( Table1[Revenue] ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Year] ),
            Table1[Primary] = MIN ( Individual[Person] )
                || Table1[Secondary] = MIN ( Individual[Person] )
        )
    )

    The result will like below:

    Best Regards,

    Teige