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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
danishrizvi
Frequent Visitor

Dynamically Change Matrix Rows Based on Slicer Selection in Power BI from Multiple tables

I am working on a Power BI report where I have three datasets, each representing data for a different website. The datasets have identical column structures but contain different values. Here is an example of the structure:

- Site 1 Table: Contains data for Website 1 (e.g., Keywords, Clicks, Impressions, etc.)
- Site 2 Table: Contains data for Website 2 (same columns but different values)
- Site 3 Table: Contains data for Website 3 (same columns but different values)

I want to create a single Matrix Visual that dynamically displays the rows (specifically the "Keywords" column) based on the slicer selection. For example:
- If I select Site 1 in the slicer, the Matrix should display the Keywords from the Site 1 dataset in the rows.
- If I select Site 2, it should show the Keywords from the Site 2 dataset, and so on.

I understand that measures in Power BI are designed to return scalar values, while I need to dynamically show a column of text values (i.e., the "Keywords" column) in the Matrix Visual rows. I have tried creating measures to dynamically switch between tables, but measures do not support returning multiple text values to populate the rows.

What I've Tried
Using Measures: I created measures to dynamically calculate numeric values (e.g., Clicks, Impressions) for the Matrix Visual, and they work fine for the columns or values section. However, this approach does not work for dynamically populating the rows with text data (Keywords).

Is there a way to dynamically switch the rows in the Matrix Visual (to display "Keywords") based on slicer selection?

2 ACCEPTED SOLUTIONS
N0EL
Resolver I
Resolver I

Hey @danishrizvi 

Thinking maybe Field Paramters could work.

Here's a quick example I created and a link to a Microsoft resource page:   Implement data translation using field parameters

2025-01-10_17-09-40.gif

View solution in original post

I tried this approach, and it worked flawlessly. The solution is straightforward: I used a field parameter and added all the required columns to it. I renamed the field parameters based on the slicer I was using on the page. Then, I created a 1:* relationship between the field parameter and my slicer table to filter the data. I ensured this relationship was active so the values displayed correctly based on the slicer selection. 

danishrizvi_0-1736764639170.png


I used the field parameter in my rows, allowing the table's column to dynamically change based on the slicer selection.

danishrizvi_1-1736764695504.png

 



View solution in original post

5 REPLIES 5
rohit1991
Super User
Super User

To dynamically change Matrix rows based on slicer selection:

  1. Combine Tables:
    Append Site 1, Site 2, and Site 3 tables into a single table in Power Query. Add a Site column to identify the source.

    Example table structure:

    Keywords Clicks Impressions Site
    Keyword 11001000Site 1
    Keyword A50300Site 2

     

     

    1. Create a Slicer:
      Use the Site column in a slicer for site selection.

    2. Configure Matrix Visual:

      • Add Keywords to Rows.
      • Add metrics (e.g., Clicks, Impressions) to Values.
    3. Optional: Enable single-select in the slicer for cleaner filtering.

    This approach dynamically updates rows based on slicer selection.




Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
danextian
Super User
Super User

Hi @danishrizvi 

 

If you need to dynamically display only a single column, using Field Parameters, as suggested by @danishrizvi,  will work. However, this approach won't apply to multiple columns. Since the datasets share a similar structure but differ in values, consider combining them into one table using the append feature in the query editor. Make sure to add a column in each original query to identify the site they correspond to, if this information isn't already included.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
N0EL
Resolver I
Resolver I

Hey @danishrizvi 

Thinking maybe Field Paramters could work.

Here's a quick example I created and a link to a Microsoft resource page:   Implement data translation using field parameters

2025-01-10_17-09-40.gif

I tried this approach, and it worked flawlessly. The solution is straightforward: I used a field parameter and added all the required columns to it. I renamed the field parameters based on the slicer I was using on the page. Then, I created a 1:* relationship between the field parameter and my slicer table to filter the data. I ensured this relationship was active so the values displayed correctly based on the slicer selection. 

danishrizvi_0-1736764639170.png


I used the field parameter in my rows, allowing the table's column to dynamically change based on the slicer selection.

danishrizvi_1-1736764695504.png

 



Ritaf1983
Super User
Super User

Hi @danishrizvi 

please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.

Top Solution Authors