Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi Team,
I have to create a user report below is an example of the data set.
I have to show data of only those users who logged in.
user name who logged in I can get it from the (USERNAME() // or USERPRINCIPALNAME()) function.
Not getting how to filter data from the dataset dynamically. I don't want to use row-level security.
it's fine that the user can view all the data from the dataset if he wants but first-time users should see their own data.
Not getting any response just checking is it possible or not in Power BI desktop?
1 . Full Dataset
ID | Name | Sales | |
1 | Alex | 1000 | |
2 | Jack | 2000 | |
3 | Alex | 200 | |
4 | Chris | 300 |
2. When Alex logs in he should see data like
ID | Name | Sales | |
1 | Alex | 1000 | |
3 | Alex | 200 |
Solved! Go to Solution.
Hi @RAWA96 ,
There is no native function to get the username in Power Query.
But based on the description since users have the option to view their own and all data, you may choose to consider using Enter tables and measure to filter reports.
Measure =
IF (
SELECTEDVALUE ( 'Table 2'[Data] ) = "All data",
1,
IF ( SELECTEDVALUE ( 'Table'[Email] ) = USERPRINCIPALNAME (), 1 )
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi @RAWA96 ,
There is no native function to get the username in Power Query.
But based on the description since users have the option to view their own and all data, you may choose to consider using Enter tables and measure to filter reports.
Measure =
IF (
SELECTEDVALUE ( 'Table 2'[Data] ) = "All data",
1,
IF ( SELECTEDVALUE ( 'Table'[Email] ) = USERPRINCIPALNAME (), 1 )
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Thanks, Gao! It worked.
I have one more question I have to show the sum of Sales total in Cards and it should also filter according to user login, how can I do that?
I tried but I am able to see the full values.
also, can we filter data on the basis of multiple columns like if I have two columns as email id one for supervisor and one for employee?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
27 | |
27 | |
24 | |
13 | |
10 |
User | Count |
---|---|
24 | |
21 | |
19 | |
19 | |
11 |