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
CMSGuy
Helper III
Helper III

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      
1 ACCEPTED SOLUTION
RMDNA
Solution Sage
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.

 

RMDNA_0-1681842114451.png

 

RMDNA_1-1681842134382.png

 

View solution in original post

2 REPLIES 2
RMDNA
Solution Sage
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.

 

RMDNA_0-1681842114451.png

 

RMDNA_1-1681842134382.png

 

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

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.