Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 time to the revenue total.
I used the following measure to account for theat:
Solved! Go to Solution.
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.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
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.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |