'How to create a new measure involving more than 3 tables in PowerBI (CALCULATE, COUNT, USERELATIONSHIP)?

I have this in SQL:

SELECT
    COUNT(*) 
FROM
base.tableA AS A
INNER JOIN base.tableB AS B ON A.acronym = B.acronym  AND A.Year_in = B.Year_in
INNER JOIN  base.tableC AS C ON A.CodBug = C.CodBug 
WHERE 
 C.TH=3

I'm doing this in Power BI, but returns as error ?

CALCULATE(
    COUNT('base tabelA'[CodId]),
    USERELATIONSHIP('base tabelA'[CodBug],'base tabelC'[CodBug]),
    'base tabelA'[TH] IN {3}
    )

Any suggestions on how to do it correctly, in Power BI?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source