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.
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
Project | Ouput | Scenario |
Initiative A | 1 | 1 |
Initiative A | 2 | 2 |
Initiative A | 3 | 3 |
Initiative B | 4 | 1 |
Initiative B | 5 | 2 |
Initiative B | 6 | 3 |
Initiative C | 7 | 1 |
Initiative C | 8 | 2 |
Initiative C | 9 | 3 |
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
Project | Output | Scenario |
Initiative A | 1 | 1 |
Initiative B | 4 | 1 |
Initiative C | 7 | 1 |
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
Solved! Go to Solution.
Hi, @TReynolds
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
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.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @TReynolds
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
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.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |