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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Zakhamido
Frequent Visitor

Incorrect Calculated Column Value

Hi Guys I need your help, I have 2 columns that was created in power query with formulas. The first column was to calculate the duration of opened cases by minutes using the following code Duration in Minutes = Duration.TotalMinutes(DateTime.LocalNow() - [Creation Date]) and then the second column to return the value yes or no based on the open time of the cases with the following code if [Case Type]="Water Emergency" and [Duration in Minutes]>=180
then "Yes"
else if [Case Type]="Unknown Water Customer Complaint" and [Duration in Minutes]>=180
then "Yes"
else if [Case Type]="Electricity Emergency" and [Duration in Minutes]>=120
then "Yes"
else if [Case Type]="Unknown Electricity Customer Complaint" and [Duration in Minutes]>=120
then "Yes"
else "No"

 

and then I created cards and slicers to return the number of cases that exceeded SLA and all is good and getting the correct number in power bi desktop. However, after I publish the report it will show the SLA cases number correct until the first refresh of the data and then I will keep on getting a number that does not match the exact same file on the power bi Desktop and below is a sample of the difference in numbers and I made sure that all the filters were cleared and data was refreshed and the same in both files 

 

Zakhamido_0-1690465671353.png

In Power Bi Desktop 

Zakhamido_1-1690465756582.png

Published Report 

 

I tried every thing and couldn't find a solution, I even dowloaded the published file and when opening it on desktop it will show the correct number

1 ACCEPTED SOLUTION
blopez11
Super User
Super User

It is likely because in the Power BI service datetime.localnow returns the date/time in UTC, which you should be able to validate.

View solution in original post

3 REPLIES 3
blopez11
Super User
Super User

It is likely because in the Power BI service datetime.localnow returns the date/time in UTC, which you should be able to validate.

thank you so much!!
Instead of using DateTime.LocalNow(), I had to use DateTimeZone.UtcNow() + TIME(4,0,0) 

Thaaaanks Man , you are a legend 

Helpful resources

Announcements
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors