Forum Discussion
Anonymous
7 years agoNot applicable
USERELATIONSHIP with multiple columns
For the god sake, help! I have a table called 'Grade Checkin' and in this table there is this columns [Serviço], [Data], [Serviço.ID1] and [Serviço.ID2]. [Serviço] should be a number, but is ...
d_gosbell
7 years agoSuper User
When you have nested calculates like this and the two USERELATIONSHIP functions affect the same two tables what happens is that Power BI will not use both relationships, instead the inner calculate function will override the outer one. The fix for this would be to just add the results of the two relationships together
eg.
.Checkin Etrip =
CALCULATE(
COUNTROWS(
FILTER(
'Passagens Sing';
[Check-in]="Checkin e-trip"
));
USERELATIONSHIP('Grade Checkin'[Serviço.ID1];'Passagens Sing'[Serviço.ID]);
ALL('Grade Checkin'[Lançamento])
)
+
CALCULATE(
COUNTROWS(
FILTER(
'Passagens Sing';
[Check-in]="Checkin e-trip"
));
USERELATIONSHIP('Grade Checkin'[Serviço.ID2];'Passagens Sing'[Serviço.ID])
)