Forum Discussion
Greeting User Login Message
- 3 years ago
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/
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/
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
- tackytechtom3 years ago
Most 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/ - tackytechtom3 years ago
Most Valuable Professional
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/