Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Row level security error in Power BI with Tabular Model

I've a problem with row level security in a Tabular Model. This is the error:

Errore_delle_08.58.png

I've a very big Tabular Model with some Roles. One of this Role, let's call it "Role01", is necessary to hide some information, depending of who access to the model. So I've this DAX query applied to a table "tableA":

'tableA'[ide cli]=LOOKUPVALUE('RLS table'[IDE_CLI], 'RLS table'[DEN_EMAIL], USERNAME(), 'RLS table'[IDE_CLI], 'tableA'[ide cli])

this DAX query filter 'tableA' depending on the 'E-mail' values in 'RLS table' when the DEN_EMAIL = USERNAME(). 'RLS table' is a calculated table created by a NATURALINNERJOIN between other 2 tables in my Model.

this is the xmla partition code for the 'RLS table':

"partitions": [
    {
      "name": "CalculatedTable 1",
      "source": {
        "type": "calculated",
        "expression": [
          "NATURALINNERJOIN ( ",
          "\tSELECTCOLUMNS (",
          "        TABLE_01,",
          "\t\t\"DEN_EMAIL\",TABLE_01[DEN_EMAIL],",
          "        \"IDE\", TABLE_01[IDE]+0",
          "\t\t    )",
          "\t,SELECTCOLUMNS (",
          "        TABLE_02,",
          "\t\t\"IDE_CLI\", TABLE_02[Ide cli],",
          "\t\t\"IDE_AGENT\", TABLE_02[Ide age],",
          "\t\t\"DAT_FINE_VALID\", TABLE_02[Date],",
          "        \"IDE\", TABLE_02[Ide]+0",
          "    )",
          "\t) ",
          ""
        ]
      }
    }
  ]

My problem is this error does not always happen but seems to be random. From the tests carried out it seems to happen during the processing of the model.

Can anyone tell me what the problem might be?

Thanks

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on my research, it may caused by the LOOKUPVALUE()  function return an error for more than one value matched, we can try to use the following rls rules for this role

 

'tableA'[ide cli] =
LOOKUPVALUE (
    'RLS table'[IDE_CLI],
    'RLS table'[DEN_EMAIL], USERNAME (),
    IF ( COUNTROWS ( 'RLS table' ) > 0, MAX ( 'RLS table'[IDE_CLI] ), BLANK () )
)

 

Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors