Pivot, Lookup or something else

689touch

New Member
Joined
Jun 29, 2007
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I have a dataset as attached in the image. There are further columns but this will explain the issue.

I would like to be able to pick a certain process, for example:
GS_RW_MDH_Window_Center Accounts
and determine who (column A) has access to this process. In this case there are two people (highlighted in green)

I have shown a further example where three people have access to another process.

Any thoughts on best way to do this please. I have a master list of approx 25 processes.

THANK YOU!
 

Attachments

  • Screenshot 2024-03-28 110308.png
    Screenshot 2024-03-28 110308.png
    61.2 KB · Views: 6

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I would simply unpivot the data with Power Query. You would then have a table with UserName, Group No, Process and you could just filter on any or all of those 3 fields.
 
Upvote 0
Test Data:

20240328 PQ Unpivot 689touch.xlsx
ABCDEFG
1UsernameGroup 1Group 2Group 3Group 4Group 5Group 6
2FredAllDomain UsersGS_RW_MDH_Window_Center AccountsCash_ReportCenter_StaffProcessControl
3JimAllDomain UsersTLDCOVIDProcessControlSupervisors
4SamAllDomain Users
5RodAllDomain UsersProcessControlWGShareWindowCentersProcessing
6MartinAllCompany CarDomain UsersSSLVPNLincolnGS_RW_MDH_Window_Center Accounts
7BrettAllDomain UsersEmployee InfoSSLVPNHR
Sheet1


Result with filter applied to table in Excel:

20240328 PQ Unpivot 689touch.xlsx
ABC
1UsernameGroupProcess
4FredGroup 3GS_RW_MDH_Window_Center Accounts
27MartinGroup 6GS_RW_MDH_Window_Center Accounts
Table1


Power Query code

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Username"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Group"}, {"Value", "Process"}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Username", type text}, {"Group", type text}, {"Process", type text}})
in
    #"Changed Type"

Power Query Steps
1711627262017.png
 
Upvote 0
Test Data:

20240328 PQ Unpivot 689touch.xlsx
ABCDEFG
1UsernameGroup 1Group 2Group 3Group 4Group 5Group 6
2FredAllDomain UsersGS_RW_MDH_Window_Center AccountsCash_ReportCenter_StaffProcessControl
3JimAllDomain UsersTLDCOVIDProcessControlSupervisors
4SamAllDomain Users
5RodAllDomain UsersProcessControlWGShareWindowCentersProcessing
6MartinAllCompany CarDomain UsersSSLVPNLincolnGS_RW_MDH_Window_Center Accounts
7BrettAllDomain UsersEmployee InfoSSLVPNHR
Sheet1


Result with filter applied to table in Excel:

20240328 PQ Unpivot 689touch.xlsx
ABC
1UsernameGroupProcess
4FredGroup 3GS_RW_MDH_Window_Center Accounts
27MartinGroup 6GS_RW_MDH_Window_Center Accounts
Table1


Power Query code

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Username"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Group"}, {"Value", "Process"}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Username", type text}, {"Group", type text}, {"Process", type text}})
in
    #"Changed Type"

Power Query Steps
View attachment 109121
Hi Alex,
The Power Query functionality has worked well. Thank you for your help!
 
Upvote 0
You did well to get it up and running that quickly (y). Thanks for letting me know and glad I could help.
 
Upvote 0

Forum statistics

Threads
1,215,072
Messages
6,122,968
Members
449,095
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top