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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have the following table1:
| Task | Status | user1 | user2 |
| 1 | Completed | Other | Other |
| 2 | Completed | USERPRINCIPALNAME | Other |
| 3 | Pending | Other | USERPRINCIPALNAME |
| 4 | Pending | USERPRINCIPALNAME | Other |
| 5 | Pending | Other | Other |
And I've added the following measure:
Measure1 = IF(
table1[user1]=USERPRINCIPALNAME ||
table1[user2]=USERPRINCIPALNAME,
1,0).
How should I include a pie chart that filters by USERPRINCIPALNAME, and therefore returns 3 tasks according to the example table: 1 completed and 2 pending?
Thanks for your support.
Solved! Go to Solution.
I found the solution with the following measure:
Measure2 = CALCULATE(COUNT(table1[Status],
table1[user1]=USERPRINCIPALNAME() ||
table1[user2]=USERPRINCIPALNAME()
)
@PowerBIuser_2, Calculate a fifth column say "final user" - to populate with "USERPRINCIPALNAME" if user1 or user2 = USERPRINCIPALNAME. Filter by this "final user" column.
I found the solution with the following measure:
Measure2 = CALCULATE(COUNT(table1[Status],
table1[user1]=USERPRINCIPALNAME() ||
table1[user2]=USERPRINCIPALNAME()
)
@meenakp Power BI gives me the following error: USERPRINCIPALNAME function is not supported on calculated columns
Hi @Greg_Deckler,
Thanks for your quick response.
I don't use RSL, because in my dashboard I also have a table that I apply the Measure1 in the filter (Measure1 is "1") and only the USERPRINCIPALNAME tasks appear.
My problem is with the pie chart. In Details section I can put the user1 and then the filter with the Measure1 works fine, but only apply the filter for the user1 column. I need take in account both columns: user1 & user2, as the table does.
The table show me 3 task as a USERPRINCIPALNAME (it's correct), but I don't get the same result in the pie chart...
@PowerBIuser_2 Use RLS?Row-level security (RLS) with Power BI - Power BI | Microsoft Learn
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |