DAX - Bring back all records from a team where the logged in user is in the team

独自空忆成欢 提交于 2019-12-13 03:07:32

问题


I have Row Level Security applied in Dynamics CRM for Power BI embedded. The logged in user only sees their data and now I'd like for them to see all teams data that the logged in user is part of.

Bring back all team data that Lucy appears in:

Logged in user: Lucy Username: user1

TEAM A
Record 1 (Lucy)
Record 2 (Bob)
Record 3 (Lucy)

TEAM B
Record 4 (Lucy)
Record 5 (Kate)
Record 6 (Paul)

TEAM C
Record 7 (Lucy)
Record 8 (Bill) 

Team D
Record 9 (John)
Record 10 (Jane)

The DAX should bring back all records from Team A, Team B and Team C but not Team D as Lucy is not in this team.

I have tried this code:

EVALUATE
   FILTER(
   Teams,
   AND(Teams[Members] = "Lucy",Teams[User] = "user1"))

However the above code only shows the filtered out values.

I want to show all the names that appear in the teams if the logged in user is part of that team.

How would this be written using DAX?

来源:https://stackoverflow.com/questions/56221161/dax-bring-back-all-records-from-a-team-where-the-logged-in-user-is-in-the-team

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!