Forum Discussion

tomperro's avatar
tomperro
Helper V
1 year ago
Solved

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

 

DepartmentFull NameTraining ClassificationDate Complete
Department 1John DoeTraining 101/01/2024
Department 1John DoeTraining 202/02/2024
Department 1John DoeTraining 303/03/2024
Department 2Bill SmithTraining 404/04/2024
Department 2Bill SmithTraining 505/05/2024
Department 2Bill SmithTraining 606/06/2024
Department 3Mary JonesTraining 707/07/2024
Department 3Mary JonesTraining 808/08/2024
Department 3Mary JonesTraining 909/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

DepartmentEmployeeTraining 1Training 2Training 3
Department 1John Doe01/01/202402/02/202403/03/2024

 

Slicer Section = Department 2

DepartmentEmployeeTraining 4Training 5Training 6
Department 2Bill Smith04/04/202405/05/202406/06/2024

 

Slicer Section = Department 3

DepartmentEmployeeTraining 7Training 8Training 9
Department 3Mary Jones07/07/202408/08/202409/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

  • vanessafvg's avatar
    vanessafvg
    Community 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.