Forum Discussion
Total revenue generated per year combining multiple roles?
- 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
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