Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Using variable name as column name in DAX

I'm trying to build dynamic RCL in PowerBI. Below is my table structures.   AccessControlTable  MailID Entity EntityValue jan_doe Unit ABC joe_doe SubUnit DEF   ProjectDetails ...
  • AlexisOlson's avatar
    3 years ago

    I don't think it's possible to dynamically reference a column using a string variable in DAX, unfortunately. (Anyone please correct me if this is not true.)

     

    I'd recommend unpivoting your ProjectDetails table to match the shape of the AccessControlTable like this:

     

    Then you should be able to write something like

    CONTAINSROW ( { ENTITY, ENTITYVALUE }, ProjectDetails[Entity], ProjectDetails[EntityValue] )