Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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 ) )
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
89 | |
87 | |
82 | |
64 | |
49 |
User | Count |
---|---|
124 | |
110 | |
88 | |
68 | |
66 |