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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
duddys
Helper I
Helper I

Different data on server compared to data to pbi desktop

So, I have this visualization that shows logged in users on production stations. The problem is that the logins are in table wgere for us the only relevant data are name, stationID, login and logout. There is no data with null logout, so that option is not happening. I dont know what causes the problem but in PBI Desktop, there is no login for any station (all the data in table are at least 2 days old, so it cant even be that the server in in different time zone) and on power bi report server, for every station that has a row in the table it shows logged in user. Sharing the whole measure here.

StationDisplay_WorkersURL_LOGIN =
VAR station     = SELECTEDVALUE('OrgStructure'[STATION])
VAR stationID   = SELECTEDVALUE('OrgStructure'[ID_STATION])
VAR nowTime     = NOW()

-- Is someone currently logged in?
VAR worker =
    CALCULATE(
        MAX('StationLogins'[NAME]),
        FILTER(
            'StationLogins',
            'StationLogins'[STATION_ID] = stationID &&
            'StationLogins'[LOGIN] <= nowTime &&
            (
                ISBLANK('StationLogins'[LOGOUT]) || nowTime <= 'StationLogins'[LOGOUT]
            )
        )
    )

VAR isLoggedIn = NOT ISBLANK(worker)

-- Get selected display mode ("Show" or "Hide")
VAR show = SELECTEDVALUE('Settings'[ShowWorkerNames], "Show")

-- Get selected login status filter
VAR loginFilter = SELECTEDVALUE(LoginStatusFilter[Status], "All")

-- Should this station be shown based on login status?
VAR showBasedOnLogin =
    SWITCH(
        loginFilter,
        "All", TRUE(),
        "Logged In", isLoggedIn,
        "Logged Out", NOT isLoggedIn,
        FALSE
    )

-- If not to be shown, return BLANK()
VAR displayWorker =
    SWITCH(
        TRUE(),
        show = "Hide" && NOT isLoggedIn, "",                  -- Hide names + no one logged in → empty
        show = "Hide" && isLoggedIn, "👤",                    -- Hide names + someone logged in → icon
        show = "Show" && NOT isLoggedIn, "👤 —",              -- Show names + no one logged in
        show = "Show" && isLoggedIn, "👤 " & worker,          -- Show names + worker name
        "" -- fallback
    )

RETURN
IF(showBasedOnLogin, station & UNICHAR(10) & displayWorker, BLANK())
1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Thank you, @pankajnamekar25@Demert for your response.

 

Hi duddys,

Thank you for the follow-up.

Based on my understanding, the difference you are observing between Power BI Desktop and Power BI Report Server arises due to the manner in which the NOW() function is evaluated in each environment. In Power BI Desktop, the NOW() function is evaluated once when the report is initially opened. However, in Power BI Report Server, the NOW() function is evaluated each time a visual is rendered, based on the server’s current system time.

Although your data is over two days old, this difference in evaluation context can lead to inconsistencies in how the visuals behave. The server might interpret certain sessions as "active" if the NOW() function’s value falls within the [LOGIN] to [LOGOUT] period at the time of rendering.

Please follow the steps below, which may help to resolve this issue:

  1. Use a consistent, refresh-controlled timestamp instead of relying on the volatile NOW() function. Create a table named NowTimeTable with one column and one row as shown below:
    NowTimeTable = DATATABLE("NowTime", DATETIME, {{ NOW() }})

  2. Use this table in your measures instead of the NOW() function. Replace all instances of NOW() in your measures with the variable nowTime, defined as:
    VAR nowTime = MAX('NowTimeTable'[NowTime])
    This approach ensures consistent evaluation across all environments and avoids discrepancies between client-side and server-side rendering.

If you find our response helpful, kindly consider marking it as the accepted solution and providing kudos. This will assist other members of the community facing similar issues.

Should you have any further queries, please feel free to reach out to the Microsoft Fabric community.

Thank you.

View solution in original post

7 REPLIES 7
v-pnaroju-msft
Community Support
Community Support

Hi duddys,

We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi duddys,

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

If you found our response useful, kindly mark it as the accepted solution to guide other members.Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.

 

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi duddys,

We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

If you find the response helpful, please mark it as the accepted solution, as this will help other members with similar queries.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Thank you, @pankajnamekar25@Demert for your response.

 

Hi duddys,

Thank you for the follow-up.

Based on my understanding, the difference you are observing between Power BI Desktop and Power BI Report Server arises due to the manner in which the NOW() function is evaluated in each environment. In Power BI Desktop, the NOW() function is evaluated once when the report is initially opened. However, in Power BI Report Server, the NOW() function is evaluated each time a visual is rendered, based on the server’s current system time.

Although your data is over two days old, this difference in evaluation context can lead to inconsistencies in how the visuals behave. The server might interpret certain sessions as "active" if the NOW() function’s value falls within the [LOGIN] to [LOGOUT] period at the time of rendering.

Please follow the steps below, which may help to resolve this issue:

  1. Use a consistent, refresh-controlled timestamp instead of relying on the volatile NOW() function. Create a table named NowTimeTable with one column and one row as shown below:
    NowTimeTable = DATATABLE("NowTime", DATETIME, {{ NOW() }})

  2. Use this table in your measures instead of the NOW() function. Replace all instances of NOW() in your measures with the variable nowTime, defined as:
    VAR nowTime = MAX('NowTimeTable'[NowTime])
    This approach ensures consistent evaluation across all environments and avoids discrepancies between client-side and server-side rendering.

If you find our response helpful, kindly consider marking it as the accepted solution and providing kudos. This will assist other members of the community facing similar issues.

Should you have any further queries, please feel free to reach out to the Microsoft Fabric community.

Thank you.

Demert
Resolver III
Resolver III

Hi,

The data your are pulling from the server is it a real time connection to see who's logged in at this exact moment? Because Now() is a datetime and if you only refresh the data in PowerBI once a day it would be hard to use Now() and expect to see the people logged in at this moment. If you only need the date portion you can use Today(). Also is Login and Logout in datetime because if not it is also hard to compare it to Now(). 

 

I would also suggest if none of it works to check if there is actually somebody logged in right now in your PowerBI Dataset. 

pankajnamekar25
Super User
Super User

Hello @duddys 

Root Cause

 NOW() behaves differently in Power BI Desktop vs. Report Server

In Power BI Desktop, NOW() uses your local machine’s time.

In Power BI Report Server, NOW() uses the server's system time (which could be UTC or some other time zone).

This means that on the server, NOW() might still fall within the [LOGIN] to [LOGOUT] range for old records, while on your desktop it does not.

Thanks

 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

As I said in the topic, there is data at least 2 days old, so it cant happen because of different time zone of server.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors