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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
NickzNickz
Helper IV
Helper IV

Greeting User Login Message

Hi ... 

 

I have below measures to greet users who access the dashboard. 

Greeting User = 
VAR _User = USERNAME()
VAR _Hour = HOUR(NOW())
VAR _Prefix =
    SWITCH(
        TRUE(),
        _Hour < 12, "Good Morning ",
        _Hour >= 12 && _Hour < 17, "Good Afternoon ",
        "Good Evening "
    )

RETURN
CONCATENATE(_Prefix, _User)

However, it shows us the DOMAIN\Username ... 

How can I return the value with the user's Full Name or without DOMAIN\ ...

 

Regards,

NickzNickz

 

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @NickzNickz ,


What a great idea to greet your users! 

 

How about this:

Measure = 
VAR _User = USERNAME()
VAR _Hour = HOUR(NOW())
VAR _Prefix =
    SWITCH(
        TRUE(),
        _Hour < 12, "Good Morning ",
        _Hour >= 12 && _Hour < 17, "Good Afternoon ",
        "Good Evening "
    )

RETURN
CONCATENATE(_Prefix, SUBSTITUTE(_User, "DOMAIN\", "") )

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

8 REPLIES 8
tackytechtom
Super User
Super User

Hi @NickzNickz ,


What a great idea to greet your users! 

 

How about this:

Measure = 
VAR _User = USERNAME()
VAR _Hour = HOUR(NOW())
VAR _Prefix =
    SWITCH(
        TRUE(),
        _Hour < 12, "Good Morning ",
        _Hour >= 12 && _Hour < 17, "Good Afternoon ",
        "Good Evening "
    )

RETURN
CONCATENATE(_Prefix, SUBSTITUTE(_User, "DOMAIN\", "") )

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Hi @tackytechtom ,

 

I have tested and it shows me the name without the domain name..Greatttt!!!. 
I need to replace DOMAIN\ with my domain name ...😅
If I publish it at power bi service, how can I ensure the timezone follows my timezone ... 

 

Really appreciate your help @tackytechtom  ...

 

Regards,

NickzNickz

Hi @NickzNickz ,

 

You are very welcome! 🙂

 

This is a classic one. I think now() returns always UTC in the Service. You might need to add some logic to it. Here a thread that might help ypu:

 

Solved: timezone corrections on power BI service not the s... - Microsoft Power BI Community

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Hi @NickzNickz ,

 

The SUBSTTITUTE function is case sensitive. Is it "DOMAIN\" or "Domain\" or "domain\"?

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

tamerj1
Super User
Super User

Hi @NickzNickz 

please try

Greeting User =
VAR _User =
PATHITEM ( SUBSTITUTE ( USERNAME (), "/", "|" ), 2 )
VAR _Hour =
HOUR ( NOW () )
VAR _Prefix =
SWITCH (
TRUE (),
_Hour < 12, "Good Morning ",
_Hour >= 12
&& _Hour < 17, "Good Afternoon ",
"Good Evening "
)
RETURN
CONCATENATE ( _Prefix, _User )

Hi @tamerj1 ,

 

Showing me Good Afternoon only ... 😅

@NickzNickz 

Just noticed the mistake. I used "/" instead of "\" 😅

Greeting User =
VAR _User =
PATHITEM ( SUBSTITUTE ( USERNAME (), "\", "|" ), 2 )
VAR _Hour =
HOUR ( NOW () )
VAR _Prefix =
SWITCH (
TRUE (),
_Hour < 12, "Good Morning ",
_Hour >= 12
&& _Hour < 17, "Good Afternoon ",
"Good Evening "
)
RETURN
CONCATENATE ( _Prefix, _User )

@NickzNickz 

Of it it is afternoon in your local time then it should. 

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.