Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jhaast
Helper II
Helper II

Create a filter - own department & other departments

Hi people,

 

I am trying to make a report which makes it possible to show the deparment results(e.g. Department "Maintenance") and other visuals show only the result of the subdepartment of the user of the report (e.g.  Department "Maintainence" - SubDepartment "Team 1").

The purpose is to add both visuals of the report to a dashboard and based on the row level security should the visuals differ for each user.

 

Table's:

Department:

DepartmentSubDepartmentDepartmentgroup
MaintainenceTeam 1Own departement
MaintainenceTeam 2Other department
MaintainenceTeam 3Other department
ProductionTeam 1Other department

 

User:

UsernameDepartment
User 1Team 1
User 2Team 3

 

I want solve this challange to create the column DepartmentGroup with two values: "own department" and "other departments". This values do I want to define based on the User table. 

 

So for user 1 should the Department table look like this:

DepartmentSubDepartmentDepartmentgroup
MaintainenceTeam 1Own departement
MaintainenceTeam 2Other department
MaintainenceTeam 3Other department
ProductionTeam 1Other department

 

And for user 2:

DepartmentSubDepartmentDepartmentgroup
MaintainenceTeam 1Other departement
MaintainenceTeam 2Other department
MaintainenceTeam 3Own department
ProductionTeam 1Other department

 

Can somebody tell me how I can create the column Departmentgroup or an other option to create visuals based on the whole department or only the subdepartment?

 

Thank you in advance!

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @jhaast 

 

There are two departments where team1 is on. How to judge that user 1 is in ‘Maintainence’ instead of ‘Production’ ?

v-janeyg-msft_0-1621403840645.png

You can use RLS to let users view only their own department data. You need to define roles and rules within Power BI Desktop and set in service.

Reference: Row-level security (RLS) with Power BI - Power BI | Microsoft Docs

You can follow the document first, please feel free to ask me if you don’t understand.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Janey,

 

No there is a maintenance team 1 and a production team 1. Those are two different teams.  The user table was missing a third column and should look like:

jhaast_0-1621930770601.png

 

 

 

However, I want to create a calculated column with the values "own subdepartment" and "other subdepartement" in the department table, based on the deparment and subdepartment of the logged in User.
If user 1 logs in then the table should look like:

DepartmentSubDepartmentDepartmentgroup
MaintainenceTeam 1Own departement
MaintainenceTeam 2Other department
MaintainenceTeam 3Other department
ProductionTeam 1Other department

So the user 1 logs in and his Deparment + Subdepartment combination will get the label "Own department" and the other teams will get the label "Other department".

 

And if user 2 logs in, the same table should look like:

DepartmentSubDepartmentDepartmentgroup
MaintainenceTeam 1Other departement
MaintainenceTeam 2Other department
MaintainenceTeam 3Own department
ProductionTeam 1Other department

The total purpose of this challange is to create visuals for the whole deparment of the user and visuals only for the user. The user haves permissions to the data of the whole deparment (based on RLS). Some visuals should only show his/her numbers and that visual should also change for another user.

 

Those this clearify the issue?

Hi, @jhaast 

 

You can try to put RLS field(Department,SubDepartment) to slicer, then create a measure like this:

 

Departmentgroup =
IF (
    table[Department] = SELECTEDVALUE ( table[Department] )
        && table[SubDepartment] = SELECTEDVALUE ( table[SubDepartment] ),
    "Own departement",
    "Other department"
)

 

Maybe helps. If it doesn’t work, it’s probably not supported.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jhaast
Helper II
Helper II

Can somebody help me? 😇

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.