Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
I have a dataset with employee_id,Vertical,hours_avail,Hours_onleave.
I need to write a dax query for a role.The main purpose of creating that role is to restrict the user who is logged in to see only the data related to his vertical.Could some one please help me with a DAX for the same.
Example: If Employee A belongs to Vertical= Ver-123 then when he loggs into his Power BI account and has a look at the dashboard that has been shared by me he should only be able to see the data related to vertical Ver-123 and if thers an employee B belonging to vertical Ver-345 then when he loggs into his Power BI account and has a look at the dashboard that has been shared by me he should only be able to see the data related to vertical Ver-345.
Solved! Go to Solution.
@RashmitaR You can make use of Username() function to identify logged in user. In power bi service it will be user's email address. Therefore in your dataset you can include column of user email address and write DAX filter as (suppose column is called UserEmail), [UserEmail] = Username(). Provided these column is in same table, it will be filtered with Vertical column that use belongs to. BTW row level security has now moved from power bi service to power bi desktop with latest power bi desktop update.
@RashmitaR You can make use of Username() function to identify logged in user. In power bi service it will be user's email address. Therefore in your dataset you can include column of user email address and write DAX filter as (suppose column is called UserEmail), [UserEmail] = Username(). Provided these column is in same table, it will be filtered with Vertical column that use belongs to. BTW row level security has now moved from power bi service to power bi desktop with latest power bi desktop update.
User | Count |
---|---|
122 | |
69 | |
67 | |
58 | |
52 |
User | Count |
---|---|
189 | |
96 | |
67 | |
63 | |
53 |