Forum Discussion
daxman
6 years agoAdvocate II
DirectQuery tables that are being used in RLS are only updating when the model refreshes
The .pbix model I built is using primarily Import tables, but there are two security tables that I'm connecting to via DirectQuery. And those security tables are being used by some dynamic RLS code. ...
Psebastianp
6 years agoRegular Visitor
Hi daxman,
we had exactly the same problem.
The problem is that the Power BI Service caches the query to improve performance. However, since it always seems to be the same RLS statment, Power BI does not load the DQ data directly from the database, but rather from the cache.
We could work around it by including the username () function in the RLS statement (filtering all rows that contain the corresponding user mail). This has two advantages: This means that only the data for the respective user is loaded into the authorization table, and a new query-stament is created for each user, since it's always different.