Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

How to join two tables and sum

$
0
0

I have two table that I need to join.

 

The time table AgressoTime has for each worktype (BuyingDep) amount of worked hours for each month (Mth).

 

The NormType table has the worknorm hours pr. BuyingDep for each month (Mth).

 

I join the two table using the 'Merge Queries' on BuyingDep and Mth

 

To sum hours pr. BuyingDep pr. Month I create a measure:

 

BpoCostWorkedHours = CALCULATE(SUM(AgressoTime[used_hour]);AgressoTime[ProjectGroup] = "KU")

 

I need to calulate the Worked hours divided by norm pr. BuyingDep, but if I calculate this measure:

 

BpoFte = [BpoCostWorkedHours]/[BpoNormHour]

 

where BpoNormHour is data from NormType table I get the value as many times as the value is replicated since it is a many to one relation. How to get the value only once pr. BuyingDep?


Viewing all articles
Browse latest Browse all 213819

Trending Articles