Forum Discussion
Measure: SUM columns from two different tables and divde
umahm1 wrote:Hi guys,
I need your help at creating a measure.
Two tables: Revenue and WorkingHours - they are NOT related. They have one connecting key which is the countryID.
Above picture shows the workinghours table.
The measure is very simple and looks like this:
Measure X =CALCULATE(SUMX ( 'Revenue'; [DRevenue] / [Cost] ) / SUMX(WorkingHours; [Hours]))
It works fine, but the worked hours table contains hours for different countries, Audacity Find My iPhone Origin which leads to the Measure X calculating things wrongly because the denominator (SUMX(WorkingHours; [Hours])) is summing all country values.
Sample data:
RevenueWorkingHours
As best practice it regards have nation measurement and connection these tables to that and after that your measure will work fine. You can make ths nation measurement from these table utilizing DAX or PowerQuery. Fill me in as to whether you require additionally help.
- umahm18 years agoFrequent Visitor