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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
davidz106
Helper III
Helper III

Slicer to add rows instead of filter

I have two tables: 

Table 1: multiple columns, one of which is Trial_name
Table 2: one column called Reference 

Trial_name and Reference fields are related (1:many relation), i.e. Reference values are also a part of Trial_name but Trial_name has many additional entries as well.

I have many slicers that filter out Table 1 which works as intended. I would like to add additional slicer for Table 2 which instead of filtering adds selected entries/data to the dataset. 

I would like to know wheter there is a better and more efficent way to achieve this than below. I would like to avoid creating a new calculated table if possible. Ideally I would create one measure and apply it at viusal-level filters. Any ideas?

 

 

 

IsSelected = 
VAR SelectedOptions = VALUES(Table2[Reference])
RETURN
IF(
    CONTAINS(SelectedOptions, Table2[Reference], Table1[Trial_name]),
    1,
    0
)

---------------
CombinedTable = 
UNION(
    Table1,
    FILTER(
        Table1,
        Table1[IsSelected] = 1
    )
)

 

 

 




4 REPLIES 4
bhanu_gautam
Super User
Super User

@davidz106 , Your approach seems correct

You can then use this measure as a visual-level filter in your report. This will dynamically add rows to your visual based on the slicer selection from Table 2.

Add the measure IsSelectedMeasure to your visual.
Set the filter condition to show rows where IsSelectedMeasure is 1.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






I just checked and PBI does not let me do it since it want measure instead of field name for Table 1. Bolded part is problematic

IsSelected = 
VAR SelectedOptions = VALUES(Table2[Reference])
RETURN
IF(
    CONTAINS(SelectedOptions, Table2[Reference], Table1[Trial_name]),
    1,
    0
)

 

@davidz106 , Try using below measure

IsSelectedMeasure =
VAR SelectedOptions = VALUES(Table2[Reference])
RETURN
IF(
    MAXX(
        FILTER(
            Table1,
            Table1[Trial_name] IN SelectedOptions
        ),
        1
    ) = 1,
    1,
    0
)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thanks but this approach only filters by both tables rather than adds the selected values from Reference slicer.


I am a bit lost here. Maybe a calculated column and applying it as filter on page-level could work. This would be even better for me.
The only thing I would like to avoid is creating a new combined table but don't know if that is even possible.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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