Forum Discussion

Charan77's avatar
Charan77
Frequent Visitor
1 year ago
Solved

Dynamic hierarchy based on user login in a matrix visual

I have a users table where I have created hierarchy based on employee and manager ID. I have seperated individual users based on different levels ( L1 - 10 ) based on their path using lookup and path...
  • danextian's avatar
    1 year ago

    Hi Charan77 

     

    Do this: 

    Create a table with a column containing the distinct values of both L1 and L5 using either DAX or M.

    Create relationships between that table and the original Dim table - an active relationshipo to L1 and an inactive to L5 or the other way around.

    Use the column from this table in matrix as L1 and the other columns from the original table.

    Create a measure that checks whether the user is in the list to be restricted and whether the column in the second-level hierarchy is currently inscope. Invoike the inactive relationship with USERELATIONSHIP if the above conditions are true else return a the base measure/aggregation.

    Note: the boldness of the category font cannot be controlled with DAX (currently).

    Please see the attached pbix.