Forum Discussion

franciscocruz's avatar
franciscocruz
Regular Visitor
2 years ago
Solved

When running RLS, page data is not completely filtered, just some visuals. And when doing this same

Hey guys! I hope everyone is okay. I am facing a problem with my model. I have a DirectQuery connection, and when performing RLS using the user's email, the page data is partially filtered, tha...
  • franciscocruz's avatar
    franciscocruz
    2 years ago

    Hey, Daniel29195 e Anonymous!


    I managed to solve the problem. In fact, my original measurement had some conditions. It was like this:

    Goal 1 - % Achieved - C2024 =

    VAR _DaniloPEA =
    CALCULATE(
    [A+ Companies - PE - C2024],
    dFuncionario[Email] = "email.com"
    )

    VAR _DaniloRA =
    CALCULATE(
    [Goal 1 - A+ Meetings - C2024],
    dFuncionario[Email] = "email.com"
    )
    VAR _EquipePEA =
    CALCULATE(
    [A+ Companies - PE - C2024],
    ALL(dEmployee[Name], dEmployee[Email]),
    dFuncionario[E-mail Coordinator] = "email.com"
    )

    VAR _EquipeRA =
    CALCULATE(
    [Goal 1 - A+ Meetings - C2024],
    ALL(dEmployee[Name], dEmployee[Email]),
    dFuncionario[E-mail Coordinator] = "email.com"
    )

    VAR _Result =
    IF(
    SELECTEDVALUE(dEmployee[Email]) = "email.com",
    DIVIDE(
    _EquipeRA - _DaniloRA,
    _EquipePEA - _DaniloPEA
    ),
    DIVIDE(
    [1st Meetings - C2024],
    [PE Companies - C2024],
    0
    )
    )

    RETURN
    _Result

     

    So for some reason when I used RLS, the filter didn't reach some visuals. To solve the problem, I adapted the measurement and it looked like this:

     

    Goal 1 - % Achieved - C2024 =
    CALCULATE(
    DIVIDE([1st Meetings - C2024], [PE Companies - C2024]),
    dEmployee
    )

    I used CALCULATE to force the filter on the "dFuncionario" table, and in the end everything worked fine.

    Thank you very much for the time you took to help me. Thank you so!