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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Alpesh
Frequent Visitor

Different results for custom column in service

Hi, any help/thoughts, as I;m getting different results between Deskptop and Service. The service doesn;t show correct calculation...

 

Desktop (correct calculation)

Alpesh_1-1699896006370.png

 

Service (wrong calcultion):

Alpesh_0-1699895964421.png

 

Formula:

_1st Accepted Business Hours =
VAR _Start = 'Chat Table Unique'[Unprocessed Time]
VAR _End = 'Chat Table Unique'[Accepted Time]
VAR _Workhours =
SUMX(CALCULATETABLE(
    'Date - Working Hours per Day',
    DATESBETWEEN('Date - Working Hours per Day'[Date],_Start,_End),
    'Date - Working Hours per Day'[Final Working Day factoring in Holiday] = 1
    ),
    MAX(MIN('Date - Working Hours per Day'[Business End],_End) - MAX('Date - Working Hours per Day'[Business Start],_Start),0) *24
)
Return
IF(_Workhours,_Workhours,0)
1 ACCEPTED SOLUTION
Alpesh
Frequent Visitor

After alot of fault finding, it turns out that because I was converting in Power query every datetime to the local call center country it completely threw off the calculation when refreshed. So instead I used a DAX formula (TIME()) instead to convert the UTC times into the local timezones for the calculation... and now it works!!

View solution in original post

4 REPLIES 4
Alpesh
Frequent Visitor

After alot of fault finding, it turns out that because I was converting in Power query every datetime to the local call center country it completely threw off the calculation when refreshed. So instead I used a DAX formula (TIME()) instead to convert the UTC times into the local timezones for the calculation... and now it works!!

@Alpesh make sure to mark your answer as the solution so others can find this post 🙂

 

All the best!

 

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@Alpesh  Ahhh yes, that will definitely influence the outputs. Well done on finding the cause!  This post is a great post to showcase the importance of applying a systematic process for data preparation (i.e. preparation / transformation / manipulation). 

Again, great work in finding the cause! This highlights something very important which is often overlooked:  when using Power Query to manipulate / transform data, we will not be able to easily see the log of these changes directly in Canvas view.  

 

Great stuff @Alpesh!

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

TheoC
Super User
Super User

Hi @Alpesh 

 

The DAX measure looks fine and is quite logical. I don't believe that's the issue.  From my experience, there are several reasons why this could be occuring:

 

1. Time Zone differences between your computer and the browser.

2. Filters applied / not applied in Power BI Service vs Desktop.

3. Row level security (if applicable) depending on how it's set up.

 

There are potentially other reasons but hopefully one of the above will help resolve.

 

Let me know how you go.

 

Theo 🙂

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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