Forum Discussion
evgeniam
6 years agoFrequent Visitor
Incorrect DAX Measure Totals in Table Visual
Hi Power BI Experts! I am calculating Revenue per Employee as the sum of revenue time entries in the database. In cases when employees leave the company, we want to discontinue adding their ti...
- 6 years ago
Hi evgeniam
I think that something along this line should get you going:
Measure2 = SUMX ( FILTER ( 'RevenueDetail', 'RevenueDetail'[Date] <= CALCULATE ( MAX ( 'Employee'[TerminationDate] ) ) || ISBLANK ( CALCULATE ( MAX ( 'Employee'[TerminationDate] ) ) ) ), 'RevenueDetail'[RateTimesHours] )The MAX(TerminationDate) has to be evaluated on a row-by-row-basis for the Total to calculate correctly.
ImkeF
6 years agoCommunity Champion
Hi evgeniam
I think that something along this line should get you going:
Measure2 =
SUMX (
FILTER (
'RevenueDetail',
'RevenueDetail'[Date] <= CALCULATE ( MAX ( 'Employee'[TerminationDate] ) )
|| ISBLANK ( CALCULATE ( MAX ( 'Employee'[TerminationDate] ) ) )
),
'RevenueDetail'[RateTimesHours]
)
The MAX(TerminationDate) has to be evaluated on a row-by-row-basis for the Total to calculate correctly.