Forum Discussion
calculated tables do not update
I figured out how to do this but it's not pretty and really only possible with a Premium Per Capacity sku.
If you have PPC, you can connect to the XMLA endpoint in SSMS. Open the semantic model and go to tables, then right click on your calculated table and select "Process Table".
In the dialog box that opens just select "Proces Full" and then choose the Scrip button at the top and choose "Script Action to Job".
Set the SQL server agent job to execute every few minutes and it will now refresh the table on that cadence.
1. This is NOT a good solution.
2. This only is useful in very SPECIFIC use cases.
3. IS NOT AN IMMEDIATE REFRESH - This in itself makes it usless for when filtering would or should change the values of a table.
In my case, I have a table with each user's email and the specific ID that each is entitled to view in the dataset. This is referenced in dynamic row level security rules. The only way I could handle the instances where the same user would have access to more than one ID and not every ID was to take that table and create a calculated one using FILTER. This would allow me to use
[SalesGroupID] IN VALUES (CalculatedTableName[SalesGroupID]) as a the DAX rule in RLS. For my use case, it was okay if the refresh only happened every 5 minutes or so. There wouldn't be many instances where we would need to update someone's access to an individual sales group. If that does occur then it's completely reasonable for us to allow up to 5 minutes for the table to refresh.
If I could just figure out how to use VALUES (where it accepts a column) and filter that column, that would eliminate my need. However, all the filtering functions return a table and I can't take the result and grab a specific column from that function's return table. What the calculated table does is allow me to pass in the column by itself, but the only rows in that table belong to the logged in person. (i.e. CalculatedTable = FILTER(RowLevelSecurityTable, [UserEmail] = USERPRINCIPALNAME()) )
I only give backround to explain why I am using such a messy process - it's a substitute for the requisite DAX skills 😁