Forum Discussion

xuxxay88's avatar
xuxxay88
Helper I
4 years ago
Solved

RLS Dax - IF Don't RLS

Hi, Just wondering if this is possible, I have a table of UserID's, CampaignIDs I want to be able to apply a filter in Manage Roles where if the User does not have any campaigns assigned to ...
  • xuxxay88's avatar
    4 years ago

    Figured it out, it would just be "TRUE()", however that code does not work. Instead I had to create a summary table (Table 2 in the code below) of User ID and a count of Campaigns assigned to them, and then evaluate that table in the RLS DAX.

     VAR Calc =
        CALCULATETABLE (
            SUMMARIZE ( 'Table 2', [CampCount] ),
            'Table 2'[UserId] = USERNAME ()
        )
    RETURN
        IF ( SUMX ( Calc, [CampCount] ) > 0, [UserID] = USERNAME (), TRUE () )