Forum Discussion

campelliann's avatar
campelliann
Post Patron
4 years ago
Solved

Is there a difference? Userelationship vs Treatas vs In values

Hi, So I will probably get rid of userelationship because I am facing issues with Row Level Security. What I do not understand is why I am having a small difference in these measures. Summing up Userelationship measure = 22,14, the option with  TREATAS or  "In Values"  I get 22,15 on a card (although on a chart with category filter the result stays the same).

 

Measure USERELATIONSHIP=
VAR ultimo_mes =
EOMONTH ( TODAY (), -2 ) + 1
VAR Time_export_ultimo_mes =
CALCULATETABLE (
CALCULATETABLE (
ADDCOLUMNS (
SUMMARIZE (
Beebole_Time_Export,
Beebole_Time_Export[Pessoa],
Beebole_Time_Export[Mês]
),
"@Rate", CALCULATE ( MAX ( Beebole_Time_Export[Rate] ) )
),
Beebole_Time_Export[Rate] > 0,
NOT CONTAINSSTRING ( Beebole_Time_Export[Ausência], "Férias" ),
'Calendário'[Date] = ultimo_mes
),
Beebole_Time_Export[Empresa] <> "company",
USERELATIONSHIP ( Lookup_RH[Nr], Beebole_Time_Export[ID da pessoa] ),
CROSSFILTER ( 'Calendário'[Date], Lookup_RH[Admissao], NONE )
)
RETURN
AVERAGEX ( Time_export_ultimo_mes, [@Rate] )

In the other measure, I simply replace the bold part with: 
Measure with treatas: ....TREATAS(VALUES(Lookup_RH[Nr]),(Beebole_Time_Export[ID da pessoa])
Measure with Invalues: ...Beebole_Time_Export[ID da pessoa] IN VALUES(Lookup_RH[Nr])...

1 Reply