Forum Discussion
shirinshon
1 year agoNew Member
MTD calculation with condition
Hello, I'm trying to calcualte MTD Earned Hours depending on the country. I have a table called Earned Hours Report which has columns such as site_ref, Standard Earned Hours etc. For example I wa...
- 1 year ago
Use this corrected DAX formula:
Key Fix:
- Wrapped the condition 'EH Daily Report'[site_ref] = "USA" inside CALCULATE to apply it as a filter.
Earned Hours MTD USA = CALCULATE( TOTALMTD(SUM('EH Daily Report'[Standard earned hours]), DimDate[Date]), 'EH Daily Report'[site_ref] = "USA" ) - 1 year ago
Have you tried something like this to get just the USA component:
Earned Hours USA = CALCULATE (SUM ( [earnedHours] ), [Country] = "USA" )
Then using that in something like this:
MTD Earned Hours USA = TOTALMTD ( [Earned Hours USA], Dates[Date] )
ToddChitt
1 year agoSuper User
Have you tried something like this to get just the USA component:
Earned Hours USA = CALCULATE (SUM ( [earnedHours] ), [Country] = "USA" )
Then using that in something like this:
MTD Earned Hours USA = TOTALMTD ( [Earned Hours USA], Dates[Date] )