Forum Discussion
Anonymous
3 years agoNot applicable
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 ...
- 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] )
AlexisOlson
3 years agoSuper User
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] )