Forum Discussion
Dynamically Display Columns Based on Slicer Selection
I am looking to only show related columns in my table based on a slicer selection.
My slicer is for department and would like to show specific columns for each department.
All data is stored in Training Table
| Department | Full Name | Training Classification | Date Complete |
| Department 1 | John Doe | Training 1 | 01/01/2024 |
| Department 1 | John Doe | Training 2 | 02/02/2024 |
| Department 1 | John Doe | Training 3 | 03/03/2024 |
| Department 2 | Bill Smith | Training 4 | 04/04/2024 |
| Department 2 | Bill Smith | Training 5 | 05/05/2024 |
| Department 2 | Bill Smith | Training 6 | 06/06/2024 |
| Department 3 | Mary Jones | Training 7 | 07/07/2024 |
| Department 3 | Mary Jones | Training 8 | 08/08/2024 |
| Department 3 | Mary Jones | Training 9 | 09/09/2024 |
Department 1 should show Training 1 Training 2 and Training 3
Department 2 should show Training 4 Training 5 and Training 6
Department 3 should show Training 7 Training 8 and Training 9
Slicer Section = Department 1
| Department | Employee | Training 1 | Training 2 | Training 3 |
| Department 1 | John Doe | 01/01/2024 | 02/02/2024 | 03/03/2024 |
Slicer Section = Department 2
| Department | Employee | Training 4 | Training 5 | Training 6 |
| Department 2 | Bill Smith | 04/04/2024 | 05/05/2024 | 06/06/2024 |
Slicer Section = Department 3
| Department | Employee | Training 7 | Training 8 | Training 9 |
| Department 3 | Mary Jones | 07/07/2024 | 08/08/2024 | 09/09/2024 |
there are several ways to do this, depending on how you want to view it, easiest way to do this is just place the
the department into the slicer like this and place the training classification on a matrix in the column and the department, person, and date on the rows. You can adjust the formatting to your preference but you get the idea.
when you select a department from the filter
it will return what is relevant. as those are populated, if power bi does not find a value for the column it wont return it.
see solution attached.
2 Replies
- vanessafvgCommunity Champion
there are several ways to do this, depending on how you want to view it, easiest way to do this is just place the
the department into the slicer like this and place the training classification on a matrix in the column and the department, person, and date on the rows. You can adjust the formatting to your preference but you get the idea.
when you select a department from the filter
it will return what is relevant. as those are populated, if power bi does not find a value for the column it wont return it.
see solution attached.
- POSPOSPost Partisan