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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.