cancel
Showing results for 
Search instead for 
Did you mean: 

Greeting

Super User
622 Views
Super User
Super User

Greeting

Create a personalized greeting for your users with this Quick Measure. Uses USERNAME function so that doesn't work so well with Publish To Web.

 

Greeting = 
VAR user = USERNAME()
VAR hour = HOUR(NOW())
VAR minute = MINUTE(NOW())
VAR prefix = SWITCH(
                    TRUE(),
                    hour<12,"Good morning ",
                    hour<17,"Good afternoon ",
                    "Good evening "
             )
RETURN CONCATENATE(prefix,user)

Place this measure in a Card visualization.

 

If you have a lookup table of user names and friendly display names, you can do this:

 

 

Greeting1 = 
VAR user = USERNAME()
VAR display = LOOKUPVALUE(Table1[User],Table1[Email],user)
VAR display1 = IF(ISBLANK(display),"Player One", display)
VAR hour = HOUR(NOW())
VAR minute = MINUTE(NOW())
VAR prefix = SWITCH(
                    TRUE(),
                    hour<12,"Good morning ",
                    hour>=12 && hour<17,"Good afternoon ",
                    "Good evening "
             )
RETURN CONCATENATE(prefix,display1)

 

 

 


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!