The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to Solution.
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:
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() }})
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.
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.
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.
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.
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:
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() }})
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.
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.
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
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.