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
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
Employee
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
Employee
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
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.