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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tgalla01
Frequent Visitor

DateDiff Incorrect output

The code (Top part of attached image) was created to calculate the difference of the First_Order_Date from the Second_Order_Date which if done correctly should give and output of the number of days from the first order to the second order, however the output (example shown by blue arrow) is giving a very incorrect number, giving a -295 output though the orders were put in on the same day, meaning the correct output should be 0. If anyone could give an input as to the issue and a way to resolve it that would be much appreciated. Thanks!unnamed.png

1 ACCEPTED SOLUTION

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @tgalla01,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

This looks like a calculated column.  You may need to expand the filter context beyond the current row.

Yes it is a calculated column. Here is more insight on that particular piece and obviously has been a struggle. Designating the second order using this logic has been the only real way that I've been somewhat able to pin down the second order a customer has placed. 

tgalla01_0-1658411582504.png

 

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

I appreciate and thank you for the review. I see my error and will make the modification. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.