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.
All,
First:
I'm sorry if this has been covered somewhere else already. I have looked and had no luck finding anything. Also I'm newer to PBI and DAX so I'm sorry in adavance if my terminology is incorrect.
The Problem:
I have 2 tables with Project ID's that both connect to a fact table which has both project ID's and Task ID's. I need to be able to dynamically filter the task ID table with project ID's selected from both of these tables using a slicer.
See below
The Goal:
I want to be able to dynamically select a project ID from table 1 and a seperate project ID from table 2 and be able to
See below for what this should look like in theory
In the example above, I can see that when project ID 1 is selected from table 1 and project ID 2 is selected from table 2 that
Only exist in Table 1 = C & D (count of 2)
Exists in Both Table 1 & Table 2 = A & B (count of 2)
Only exist in Table 2 = E (count of 1)
My Attempt:
Again I am new to DAX but here was my best attempt. I keep getting a blank value. I can sort of see what I want in the matrix, I just cant get a single value to display.
Here is a link to download the pbix I've been using to test:
Any help is much Appreciated!!!
Thank you,
Solved! Go to Solution.
Hi @Jbrunson09
Here is the sample file with the solution https://www.dropbox.com/t/5Zi9ofCD6nZmeBUU
Table 1 Count =
COALESCE(
CALCULATE (
DISTINCTCOUNT ( 'Table 3'[Task ID]),
CROSSFILTER ( 'Table 2'[Project ID], 'Table 3'[Project ID], NONE )
),
0
)
Table 2 Count =
COALESCE(
CALCULATE (
DISTINCTCOUNT ( 'Table 3'[Task ID]),
CROSSFILTER ( 'Table 1'[Project ID], 'Table 3'[Project ID], NONE )
),
0
)
Task ID in Both Tables =
VAR SelectedIDs1 =
CALCULATETABLE (
VALUES ( 'Table 3'[Task ID] ),
CROSSFILTER ( 'Table 2'[Project ID], 'Table 3'[Project ID], NONE )
)
VAR SelectedIDs2 =
CALCULATETABLE (
VALUES ( 'Table 3'[Task ID] ),
CROSSFILTER ( 'Table 1'[Project ID], 'Table 3'[Project ID], NONE )
)
RETURN
COUNTROWS ( INTERSECT ( SelectedIDs1, SelectedIDs2 ) )
Thank you!!! Big help
Hi @Jbrunson09
Here is the sample file with the solution https://www.dropbox.com/t/5Zi9ofCD6nZmeBUU
Table 1 Count =
COALESCE(
CALCULATE (
DISTINCTCOUNT ( 'Table 3'[Task ID]),
CROSSFILTER ( 'Table 2'[Project ID], 'Table 3'[Project ID], NONE )
),
0
)
Table 2 Count =
COALESCE(
CALCULATE (
DISTINCTCOUNT ( 'Table 3'[Task ID]),
CROSSFILTER ( 'Table 1'[Project ID], 'Table 3'[Project ID], NONE )
),
0
)
Task ID in Both Tables =
VAR SelectedIDs1 =
CALCULATETABLE (
VALUES ( 'Table 3'[Task ID] ),
CROSSFILTER ( 'Table 2'[Project ID], 'Table 3'[Project ID], NONE )
)
VAR SelectedIDs2 =
CALCULATETABLE (
VALUES ( 'Table 3'[Task ID] ),
CROSSFILTER ( 'Table 1'[Project ID], 'Table 3'[Project ID], NONE )
)
RETURN
COUNTROWS ( INTERSECT ( SelectedIDs1, SelectedIDs2 ) )
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 |
---|---|
109 | |
108 | |
88 | |
75 | |
66 |
User | Count |
---|---|
125 | |
114 | |
98 | |
81 | |
73 |