Forum Discussion
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
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/
8 Replies
- tamerj1Community Champion
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 )- NickzNickzHelper IV
- tamerj1Community Champion
Of it it is afternoon in your local time then it should.
- tackytechtomMost Valuable Professional
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/- NickzNickzHelper IV
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
- tackytechtomMost Valuable Professional
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/