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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Measure and return multiple columns

Hello Folks,

 

I am filtering the data based on the current logged in user using the below query, now I would like to return some of the columns associated with that user - how to achieve that ? 

 

In the below case I get only 1 value - I tried to return a complete row but it throws me the error "Multiple columns cannot be converted to a scalar value"  - any other way to show multiple columns?

 

CurrentUserData =
VAR CurrentUserState = CALCULATE(MAX(TimeReport[UserPrincipalName]),FILTER(TimeReport, TimeReport[UserPrincipalName] = USERPRINCIPALNAME()))
RETURN
IF(
SELECTEDVALUE(TimeReport[UserPrincipalName]) = CurrentUserState,
Values(TimeReport[Neukunden_Akquise_Produkte])
)
 
Thanks
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Amit, thanks for the reply.

 

Got the solution and credit goes to @miguelarce 
https://community.powerbi.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/329584


Measure1
WhoIsWatching = USERPRINCIPALNAME() 
(that is email style usernames, or you can use USERNAME() for windows style users)

fmourtaza_0-1638771313526.png

 

 


Measure 2
FilterByViewer = IF(selectedvalue(table[email])=[WhoIsWatching],1,0)

fmourtaza_1-1638771313523.png

 

 


Drag Measure 2 as a filter for visual, select advanced filtering and set it to 
"Show items when value IS 1"

fmourtaza_2-1638771313757.png

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi Amit, thanks for the reply.

 

Got the solution and credit goes to @miguelarce 
https://community.powerbi.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/329584


Measure1
WhoIsWatching = USERPRINCIPALNAME() 
(that is email style usernames, or you can use USERNAME() for windows style users)

fmourtaza_0-1638771313526.png

 

 


Measure 2
FilterByViewer = IF(selectedvalue(table[email])=[WhoIsWatching],1,0)

fmourtaza_1-1638771313523.png

 

 


Drag Measure 2 as a filter for visual, select advanced filtering and set it to 
"Show items when value IS 1"

fmourtaza_2-1638771313757.png

 

 

amitchandak
Super User
Super User

@Anonymous , Try like

 

CurrentUserData =
VAR CurrentUserState = CALCULATE(MAX(TimeReport[UserPrincipalName]),FILTER(TimeReport, TimeReport[UserPrincipalName] = USERPRINCIPALNAME()))
RETURN
IF(
Max(TimeReport[UserPrincipalName]) = CurrentUserState,
max(TimeReport[Neukunden_Akquise_Produkte])
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.