0

I need to create a table based on a lookup. The problem is that in the CALCULATETABLE I cannot use username() function.

CALCULATETABLE (
    LOOKUPVALUE ( 'User Table'[SOC], 'User Table'[username], USERNAME () ),
    'User Table'[username] = USERNAME ()
)

Does anyone have any idea how I can proceed?

What I would like to have is a table with the list of companies for the logged-in user.

Alexis Olson
  • 38,724
  • 7
  • 42
  • 64
power83
  • 69
  • 8

3 Answers3

0

The tables in your model are computed only when the data is originally loaded or refreshed. As a result, you cannot use dynamic variables like slicer selections or usernames in their construction since those would require the tables to be recomputed each time they change.

What you can do is create visuals with measures that are filtered by username and/or use usernames as part of Row Level Security filtering.

Alexis Olson
  • 38,724
  • 7
  • 42
  • 64
0

The best option in your situation is the use of dynamic security, so that the logged in user will have access to only a subset of companies wish are related to him. With this approch no calculated table needed.

Visit : https://www.kasperonbi.com/dynamic-security-made-easy-with-ssas-2016-and-power-bi/

Naro
  • 800
  • 6
  • 11
0

Thanks for the answers, I already use the row level security to filter data but I would like to make available (for specific request) also another table containing this information.

I could create a second table and filter also it with row level security.

Thanks

power83
  • 69
  • 8