Forum Discussion
Object level security - Paginated Report (missing column)
Hi Abhinav,
I am strugling with the code and need help. Field for which I added expresion "=code.GetValue(Fields!Val_Opening_Balance_Amt.Value)" is rendering to "#error" even for me in Report Builder. Maybe it is because I am putting decimal type field and it is formatted in the matrix as number and not the string. Also I need to Return Nothing and not " ". Can you help to adjust the code? Thank you!
Hi Petra! Please pass only the field as the argument is field type
ByVal dataElement as Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field
so the code call has to be : =code.GetValue(Fields!Val_Opening_Balance_Amt). This works
- PetrarteP5 years agoFrequent Visitor
Hi Abhinav,
thanks for the info and all the help, now report is working for me as I am in the Role without OLS restrictions but users under different roles are getting same error:
Could not connect to the data source.
"There was an error communicating with Analysis Services. Please verify that the data source is available and your credentials are correct. Query (14, 84) The value for 'Val Stock Net Movement Amt' cannot be determined. Either the column doesn't exist, or there is no current row for this column.".From the error I see that probably it fails on the PowerBI Dataset as I am querieng it with DAX in Paginated Report. That is why I think I need to do something on the DAX code itself to catch an error. I am greatfull for you answers as this code will be usefull in other scenarios.Petra- v-kkf-msft5 years agoCommunity Support
Hi PetrarteP ,
In Power BI, we can only limit data access on row level.
Support for OLS in Power BI is in Preview.
Visualizations referencing a dataset object with OLS configured display the same message as for a deleted or non-existing object.
Because users under OLS roles do not have access to the column in datasource, you cannot use DAX functions such as IFERROR to try to catch errors.
As a workaround, you could use import mode, and you could unpivot your source table to convert column headers into rows. Then you can control users' access to specific columns via applying RLS indirectly. And you can put the converted column into Column group within Matrix visual to make it appear like a "column".
Reference: Unpivoting Sensitive Columns in Power BI to Apply Row-Level Security
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.