I have a following situation that I am not sure how to handle: There is a table Inovice_Item, Service and ServiceLang. Invoice_item table has FK_Service key (one to one). Service table has FK_Service_Lang key. ServiceLang table has FK_Service key so it makes it many to many relation.
In other words, Invoice_Item can have multiple ServiceLang records, which means that when I make a join query, invoice_item records get duplicated. What are the options to handle such situations?
I would like to have ServiceLang dimension in the cube, but I am not sure how to handle duplicates caused by join.
EDIT
I've made an example:
The queries are as following:
-- One lang for service A, two langs for service B
select * from ServiceLang
-- Two records: A and B
select * from Service
-- Total amount is 20
select * from InvoiceItem
-- Query to populate Fact table
-- Total amount is 30
select *
from InvoiceItem II
inner join Service S on II.FK_Service = S.PK_Service
inner join ServiceLang SL on S.PK_Service = SL.FK_Service
So, if there are two Service_Lang records related to one service than there is a duplicate row meaning that total services amount would be 30 but it should be 20. So, my question is how to handle these situations?