Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have the following table. When I select a name I want to return that Name and everyone who has a designation of staff. I know this might be a dynamic table.
| Name | Staff/Client |
| Hayes | Staff |
| Bill | client |
| Logan | client |
| Kendall | staff |
| Roy | client |
| Shiv | staff |
I need help with this measure
Staff Filter_Measure = CALCULATE(
COUNTROWS('Clients and Staff'),
FILTER(
'Clients and Staff',
'Clients and Staff'[Name] = SELECTEDVALUE('Clients and Staff'[Name])
),
FILTER(ALL('Clients and Staff'[Client Staff Flag]),'Clients and Staff'[Client Staff Flag] = "Staff"
))
Solved! Go to Solution.
Hi @chat_peters
If you just want the count, then this should work:
Staff Filter_Measure =
VAR _SelectedName = SELECTEDVALUE('Clients and Staff'[Name], "N/A")
VAR _Tbl =
ADDCOLUMNS(
ALL('Clients and Staff'),
"@isValid",
SWITCH( TRUE(),
[Staff/Client] = "Staff", 1,
[Name] = _SelectedName, 1,
0
)
)
RETURN
SUMX(_Tbl, [@isValid])
I apologize for the miscommunication. I don't want a count. If I create a filter with name field. When I pick a name I want a table showing that name and everybody with the staff designation. So for example the end result I am looking for is, if I picked Bill I want to see something like below
| Name |
| Bill |
| Hayes |
| Kendall |
| Shiv |
Thank you so much for responding! I went with the solution posted by hbguy71. Thank you both for taking the time. I am going to hold on to the pbix file in the event I need this too
Hi @chat_peters
Okay, understood, in that case, then you would adjust a few things...
You would need a disconnected table with the unique values of all the names. For simplicity sakes,
Names = DISTINCT('Clients and Staff'[Name])
Next, the measure needs to be modified to this instead:
Staff Filter_Measure =
VAR _SelectedName = SELECTEDVALUE(Names[Name]) -- Get selected name from slicer
VAR _RowName = MAX('Clients and Staff'[Name]) -- Get current row name in the visual
// Filter for all names in scope
VAR _NamesInScope =
CALCULATETABLE(
VALUES('Clients and Staff'[Name]),
'Clients and Staff'[Staff/Client] = "Staff" ||
'Clients and Staff'[Name] = _SelectedName
)
RETURN
// Check if current row name is in table output
IF(
_RowName IN _NamesInScope,
1,
BLANK()
)
And lastly, on your visual, add the measure in and filter where value is 1 like so:
And this should be your final expected output:
Hi @chat_peters
If you just want the count, then this should work:
Staff Filter_Measure =
VAR _SelectedName = SELECTEDVALUE('Clients and Staff'[Name], "N/A")
VAR _Tbl =
ADDCOLUMNS(
ALL('Clients and Staff'),
"@isValid",
SWITCH( TRUE(),
[Staff/Client] = "Staff", 1,
[Name] = _SelectedName, 1,
0
)
)
RETURN
SUMX(_Tbl, [@isValid])
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 102 | |
| 79 | |
| 57 | |
| 51 | |
| 46 |