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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
userpowerbiii12
Frequent Visitor

Display the current's user picture in Power BI

I used this measure to display a greeting message after retrieving the username of the session and the current timezone.

 

Greetings Deno = 
VAR v_LoginUserName = USERNAME() 
VAR v_hour = HOUR(UTCNOW()) 
VAR v_prefix = SWITCH(
    TRUE(),
    v_hour < 12, "🌅 Good Morning ,",
    v_hour >= 12 && v_hour <= 17, "☀️ Good Afternoon ,",
    "🌇 Good Evening ,"
) 
RETURN v_prefix & " " & v_LoginUserName & " " & " ! "

 

I wanted to ask if it is possible to display the profile picture of the current logged-in user in an image viewer? Of course , if the user has no profile picture I'll display a default one 

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @userpowerbiii12 ,

 

To display the profile picture of the current logged-in user in an image viewer, you can try the following steps:

- Create a new streaming dataset in Power BI that collects all the metadata from the dataflow run, including the user email and the image URL.
- Use a custom visual that is Image by CloudScope and store the image URL in the table as text data type.
- For the URL column, do settings like Modelling tab ->datacategory->Image URL.
- Apply dynamic RLS based on user email and the image will display based on user login.
- If the user has no profile picture, you can use a default image URL as a fallback option.

 

Please refer to the following document for more information.

(1) Add images, videos, and more to your dashboard - Power BI
(2) How to display user image dynamically based on use 
(3) Add Photos to Power BI from Active Directory - RADACAD

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
v-tangjie-msft
Community Support
Community Support

Hi @userpowerbiii12 ,

 

To display the profile picture of the current logged-in user in an image viewer, you can try the following steps:

- Create a new streaming dataset in Power BI that collects all the metadata from the dataflow run, including the user email and the image URL.
- Use a custom visual that is Image by CloudScope and store the image URL in the table as text data type.
- For the URL column, do settings like Modelling tab ->datacategory->Image URL.
- Apply dynamic RLS based on user email and the image will display based on user login.
- If the user has no profile picture, you can use a default image URL as a fallback option.

 

Please refer to the following document for more information.

(1) Add images, videos, and more to your dashboard - Power BI
(2) How to display user image dynamically based on use 
(3) Add Photos to Power BI from Active Directory - RADACAD

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

So you are saying that it's a good idea to get the entire list profiles of a company with thousands/millions of users?  I don't think so.. 

amitchandak
Super User
Super User

@userpowerbiii12 , You can use userprincipalname() in a measure, that will give the user's email. Using that you can create a name measure and url measure to display name and image

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.