cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Filtering a table based on selections from multiple slicers using the same information

Hi forum,

 

I have a dataset that has a list of projects and their outputs. Each project has different a output depending on the scenario in place.

 

Table 1: Dataset

ProjectOuputScenario
Initiative A11
Initiative A22
Initiative A33
Initiative B41
Initiative B52
Initiative B63
Initiative C71
Initiative C82
Initiative C93

 

I wanted to be able to have three different slicers, one for each scenario. So I created three calculated tables, one for each scenario. E.g.,:

Calculated Table: Scenario 1

ProjectOutputScenario
Initiative A11
Initiative B41
Initiative C71

 

Having the three calculated tables worked well for a visualization. I could use three different slicers (e.g., S1 Slicer, S2 Slicer and S3 Slicer) to select the content that would appear in a graph (e.g., Initiative A from Scenario 1, Initiative C from Scenario 2, and Initiative A from Scenario 3).

 

The problem is that I want to create a table that shows the projects that were selected by those slicers (e.g., A from S1, C from S2, and A from S3). If I use the the Project column from the original dataset, I get all of the projects — all Initiatives A, B and C for each Scenario 1, 2 and 3  — instead of only A from S1, C from S2 and A from S3.

 

Any suggestions on what I can do to properly filter the table?

 

Cheers,

 

T

1 ACCEPTED SOLUTION
Community Support
Community Support

Hi, @TReynolds 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

 Table:

c1.png

 

Calculated table:

S1 = 
FILTER(
    'Table',
    [Scenario]=1
)

S2 = 
FILTER(
    'Table',
    [Scenario]=2
)

S3 = 
FILTER(
    'Table',
    [Scenario]=3
)

 

You may create a measure as below.

Visual Control = 
IF(
    (SELECTEDVALUE('Table'[Project]) in DISTINCT(S1[Project])&& SELECTEDVALUE('Table'[Scenario]) in DISTINCT(S1[Scenario]))||
    (SELECTEDVALUE('Table'[Project]) in DISTINCT(S2[Project])&& SELECTEDVALUE('Table'[Scenario]) in DISTINCT(S2[Scenario]))||
    (SELECTEDVALUE('Table'[Project]) in DISTINCT(S3[Project])&& SELECTEDVALUE('Table'[Scenario]) in DISTINCT(S3[Scenario])),
    1,0
)

 

Finally you need to put the meausre in the visual level filter to get the result.

c2.png

c3.png

 

Best Regards

Allan

 

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
Community Support
Community Support

Hi, @TReynolds 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

 Table:

c1.png

 

Calculated table:

S1 = 
FILTER(
    'Table',
    [Scenario]=1
)

S2 = 
FILTER(
    'Table',
    [Scenario]=2
)

S3 = 
FILTER(
    'Table',
    [Scenario]=3
)

 

You may create a measure as below.

Visual Control = 
IF(
    (SELECTEDVALUE('Table'[Project]) in DISTINCT(S1[Project])&& SELECTEDVALUE('Table'[Scenario]) in DISTINCT(S1[Scenario]))||
    (SELECTEDVALUE('Table'[Project]) in DISTINCT(S2[Project])&& SELECTEDVALUE('Table'[Scenario]) in DISTINCT(S2[Scenario]))||
    (SELECTEDVALUE('Table'[Project]) in DISTINCT(S3[Project])&& SELECTEDVALUE('Table'[Scenario]) in DISTINCT(S3[Scenario])),
    1,0
)

 

Finally you need to put the meausre in the visual level filter to get the result.

c2.png

c3.png

 

Best Regards

Allan

 

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

Helpful resources

Announcements
secondImage

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

secondImage

Power BI Women

Join our monthly meetings and learning sessions.

secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors