Power BI  

Creating a Personalized Welcome Message in Power BI Using DAX

One of the most exciting parts of Power BI is its ability to make reports feel personal. Instead of static dashboards that show the same thing to everyone, you can use DAX (Data Analysis Expressions) to customize content—for example, greeting the user by name or showing context-aware messages.

In this article, we’ll explore how to create a dynamic welcome message in Power BI that greets each user based on the time of day and their username using a simple yet powerful DAX formula.

Why Personalization Matters

Personalization adds a layer of friendliness and interactivity to your Power BI dashboards. Imagine opening your company’s sales report and seeing:

“Good Morning, Daniel”

That small touch makes users feel recognized and connected to the data they’re viewing. It also gives reports a professional, modern finish—especially in enterprise environments where dozens of users interact with shared dashboards daily.

The DAX Formula Explained

Here’s the full DAX formula that generates a personalized greeting based on the user and current time:

Welcome and current user = 
VAR CURRENT_HOUR = HOUR(NOW())
VAR GREETINGS = 
    SWITCH(
        TRUE(),
        CURRENT_HOUR >= 0 && CURRENT_HOUR < 12, "Good Morning",
        CURRENT_HOUR >= 12 && CURRENT_HOUR <= 18, "Good Afternoon",
        CURRENT_HOUR >= 18 && CURRENT_HOUR < 24, "Good Evening"
    )
VAR CURRENT_USERS = LEFT(USERPRINCIPALNAME(), 6)
RETURN
GREETINGS & ", " & CURRENT_USERS

Let’s break it down step by step 👇

🔹 Step 1. Capture the Current Hour

VAR CURRENT_HOUR = HOUR(NOW())
  • The NOW() function returns the current date and time from your local system.

  • The HOUR() function extracts just the hour portion (0–23).

  • This allows you to build time-based logic for the greeting message.

🔹 Step 2. Create the Time-Based Greeting

VAR GREETINGS = 
    SWITCH(
        TRUE(),
        CURRENT_HOUR >= 0 && CURRENT_HOUR < 12, "Good Morning",
        CURRENT_HOUR >= 12 && CURRENT_HOUR <= 18, "Good Afternoon",
        CURRENT_HOUR >= 18 && CURRENT_HOUR < 24, "Good Evening"
    )

Here, SWITCH(TRUE(), …) is a clever DAX pattern that allows you to evaluate multiple logical conditions in order.

  • Between 12:00 AM and 11:59 AM → Displays “Good Morning”

  • Between 12:00 PM and 6:00 PM → Displays “Good Afternoon”

  • Between 6:00 PM and 11:59 PM → Displays “Good Evening”

🔹 Step 3. Identify the Current User

VAR CURRENT_USERS = LEFT(USERPRINCIPALNAME(), 6)
  • The USERPRINCIPALNAME() function returns the full login name of the current user (e.g., [email protected]).

  • The LEFT() function trims it to the first 6 characters to show a concise identifier (e.g., john.d).

  • You can modify this to show more or fewer characters, or use string functions like SEARCH() and MID() to extract only the first name.

🔹 Step 4. Return the Personalized Message

RETURN
GREETINGS & ", " & CURRENT_USERS

This concatenates the two variables—time-based greeting and user name—into a single message.

6

How to Use It in Your Report

  1. Open Power BI Desktop.

  2. Go to the Modeling tab and click New Measure.

  3. Paste the DAX formula above.

  4. Add a Card Visual to your report page.

  5. Drag the new measure (Welcome and current user) into the Card.

You’ll now see a live, dynamic greeting that changes based on both time of day and who’s logged in.

dashboard

Final Thoughts

A personalized greeting may seem like a small touch, but it can dramatically improve user experience in Power BI. By combining NOW(), HOUR(), and USERPRINCIPALNAME() functions, you bring your reports to life—making them dynamic, context-aware, and human.