Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
harshanand007
Regular Visitor

Select columns in table dynamically based on Slicer

Hello All, 

 

I have a hierarchy of metrics and I want the same to be displayed on the table based on the slicer selection. 

 

For example: 

 

This is the school level data and all of the columns other than the first one is numeric. 

 

ID# StudentsStudents AttendanceTeachers AttendanceAverage Class Size
121780.80.9423
134540.70.812

 

Another table is categories of these metrics

CategoryMetrics
Students# Students
StudentsStudents Attendance
WorkforceTeachers Attendance
SchoolAverage Class Size

 

I have a slicer in my dashboard which shows Category values.

 

I want to create a table which shows me ID and the relevant metrics based on the category selection. I am using simple table graph available in Power BI.

 

If I select Students in my slicer, the table should show - ID, # Students and Students Attendance columns.

 

Could you help me how to solve this?

 

Thanks!

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @harshanand007,

 

You could unpivot the first table.

1.PNG2.PNG

 

Establish a one to many relationship between two tables based on Metrics field.

 

Then, use a Matrix visual to display data from Table1. Add category column into slicer.

3.PNG

 

Alternatively, you could try the suggestions in below articles:

Dynamic Column Based on Slicer Selection

Knowledge Base--Dynamic column based on slicer selection

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @harshanand007,

 

You could unpivot the first table.

1.PNG2.PNG

 

Establish a one to many relationship between two tables based on Metrics field.

 

Then, use a Matrix visual to display data from Table1. Add category column into slicer.

3.PNG

 

Alternatively, you could try the suggestions in below articles:

Dynamic Column Based on Slicer Selection

Knowledge Base--Dynamic column based on slicer selection

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.