Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
I have a source table below
1. I need to filter the table with the column as 'Assigned'(My assigned have userprinicpalname from office 365 and azure) = UserPrincipalName, with the result below
2. Get distinct from the 'Plan name' as below
3. Lastly with the above distinct value, filter the master table and get data as below
To summarize more
Get the distinct plan name of a user and apply the filter on the master table to get the output of all plans and actions of all users who are part of the same plan as the filtered user is
Solved! Go to Solution.
See if this works.
A) If the user is hard-coded: Create the following measure to use as a filter in the filter pane, setting the value to 1:
User 1 Plan Name =
VAR _U1 =
CALCULATETABLE (
VALUES ( fTable[Plan Name] ),
ALL ( fTable ),
fTable[Assigned] = "User 1"
)
VAR _All =
CALCULATETABLE ( VALUES ( fTable[Plan Name] ), ALL ( fTable[Assigned] ) )
RETURN
COUNTROWS ( INTERSECT ( _All, _U1 ) )
B) If you need the User selection to be dynamic:
Create a new, independent table for Users (I've called mine 'Select Users"). Leave this new table unrelated in the model:
Select Users =
DISTINCT(fTable[Assigned])
Use this measure as a filter in the filter pane and set the value to 1:
Sel User Plan Name =
VAR _U1 =
CALCULATETABLE (
VALUES ( fTable[Plan Name] ),
FILTER (
ALL ( 'fTable' ),
fTable[Assigned] IN VALUES ( 'Select Users'[Sel Assigned] )
)
)
VAR _All =
VALUES ( fTable[Plan Name] )
RETURN
COUNTROWS ( INTERSECT ( _All, _U1 ) )
Attached is the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
@PaulDBrown Worked like a charm. Thanks a lot.
I did the following changes to get the currently logged-in user principal name and match it with the email address from the table, rest measures took care of it.
See if this works.
A) If the user is hard-coded: Create the following measure to use as a filter in the filter pane, setting the value to 1:
User 1 Plan Name =
VAR _U1 =
CALCULATETABLE (
VALUES ( fTable[Plan Name] ),
ALL ( fTable ),
fTable[Assigned] = "User 1"
)
VAR _All =
CALCULATETABLE ( VALUES ( fTable[Plan Name] ), ALL ( fTable[Assigned] ) )
RETURN
COUNTROWS ( INTERSECT ( _All, _U1 ) )
B) If you need the User selection to be dynamic:
Create a new, independent table for Users (I've called mine 'Select Users"). Leave this new table unrelated in the model:
Select Users =
DISTINCT(fTable[Assigned])
Use this measure as a filter in the filter pane and set the value to 1:
Sel User Plan Name =
VAR _U1 =
CALCULATETABLE (
VALUES ( fTable[Plan Name] ),
FILTER (
ALL ( 'fTable' ),
fTable[Assigned] IN VALUES ( 'Select Users'[Sel Assigned] )
)
)
VAR _All =
VALUES ( fTable[Plan Name] )
RETURN
COUNTROWS ( INTERSECT ( _All, _U1 ) )
Attached is the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 76 | |
| 37 | |
| 31 | |
| 27 | |
| 27 |