Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
RAWA96
Regular Visitor

Search data from report dynamically using parameters and not using row level security

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

Email

Sales

1

Alex

Alexabc.com

1000

2

Jack

Jackabc.com

2000

3

Alex

Alexabc.com

200

4

Chris

Chrisabc.com

300

 

2. When Alex logs in he should see data like 

ID

Name

Email

Sales

1

Alex

Alexabc.com

1000

3

Alex

Alexabc.com

200

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vcgaomsft_1-1682387836872.png

Measure = 
IF (
    SELECTEDVALUE ( 'Table 2'[Data] ) = "All data",
    1,
    IF ( SELECTEDVALUE ( 'Table'[Email] ) = USERPRINCIPALNAME (), 1 )
)

vcgaomsft_0-1682387800524.png

vcgaomsft_2-1682387912016.png

 

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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.

vcgaomsft_1-1682387836872.png

Measure = 
IF (
    SELECTEDVALUE ( 'Table 2'[Data] ) = "All data",
    1,
    IF ( SELECTEDVALUE ( 'Table'[Email] ) = USERPRINCIPALNAME (), 1 )
)

vcgaomsft_0-1682387800524.png

vcgaomsft_2-1682387912016.png

 

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?  

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.