Forum Discussion

CMSGuy's avatar
CMSGuy
Helper III
3 years ago
Solved

Dynamic table columns based on slicer selection

I am creating a power bi report that is filtered by Month, Year, Employee, Certification.  The first column of the table is Day (of the month) that shows even days that do not have data, so I have every day of the month represented.  When Employee (and year) are selected, this will filter the Certification slicer.  When that Certification is selected, there can be a number of different tasks I need to show based on that cert.  I have some very rough sample data here that shows only 5 certs and their related tasks.  Each cert can have a different number of tasks.  The data source that is coming in is pretty flat (I have no control over it) with 32 columns just for the Task and I know, not the cleanest way to build, but I did not author the data source.  Is there a way to dynamically show the columns based on the cert selection?  Thanks for the information

 

UPDATE:  I am trying to do the pivot of the columns, however, this breaks the ID column, which has a one to many relationship with other tables.

 

IDTitleTask1Task2Task3Task4Task5Task6Task7Task8Task9Task10
1This OneThis one task2nd task for this oneAnd one more      
2Second CertTask 1 for 2ndTask 2 for 2nd       
3Make it ThreeTask 1 for 3rdTask 2 for 3rdTask 3 for 3rdTask 4 for 3rdTask 5 for 3rdTask 6 for Third   
4I am the FourthT1 for MeT2 for MeT3 for MeT4 for Me      
  • Hi CMSGuy - two primary options: either use a field parameter as your column value, or just unpivot your data. The approach depends on the other details of your reporting. Can be a table or a matrix, doesn't matter.

     

     

     

2 Replies

  • RMDNA's avatar
    RMDNA
    Solution Sage

    Hi CMSGuy - two primary options: either use a field parameter as your column value, or just unpivot your data. The approach depends on the other details of your reporting. Can be a table or a matrix, doesn't matter.

     

     

     

    • CMSGuy's avatar
      CMSGuy
      Helper III

      Now I need to research field parameters as that is something I have not explored using yet.  When I do an unpivot, there are actually more than a few columns and are just not the Tasks titles.  There is TaskHours and TaskSubmitted numbers too.  Not sure how to use that pivoted data when there is more than one different value type