Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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
)
)
@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.
Proud to be a Super User! |
|
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
Proud to be a Super User! |
|
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
57 | |
55 | |
55 | |
37 | |
30 |
User | Count |
---|---|
78 | |
66 | |
45 | |
44 | |
40 |